Grasshopper

algorithmic modeling for Rhino

Convert Rhino.Geometry.NurbsCurve to Autodesk.Revit.DB.NurbSpline

Hello,

I have a problem with conversion of Curves from Rhino to Revit. Is the Rhino Curve build up different in comparison to the Revit Curve?

Views: 1481

Replies to This Discussion

The size of knots must equal the sum of degree, the size of the controlPoints array and 1. The first degree+1 knots should be identical, as should the last degree+1 knots. Revit requires the knots in the middle of the sequence to be increasing.
Parameter name: knots

Many papers talks about interoperability that nurbs , curves and meshes are not the same in different software. No wonder why revit and rhino have different data structures.

Jepp for example Revit does not have degree 2 or 1. So Forward and Backward serialization will not be without loss. But still is here any documatation about the differences in the Curve Models?

No, I don't think there is anything. Revit API SDK is the closest thing to documentation that you will find, but it doesn't address any of your questions. Rightfully so, its for Revit API itself. I don't think anyone has ever put such document together. The best solution would be to look under the hood of plugins like Grevit which are Open Source. They deal with exactly your problem, so you can see how. 

The definition of a nurbs curve in Revit in comparison with OpenNurbs is only differing in that Revit uses a definition with two additional knots, so make sure you add a duplicate of the first and last in your conversion.

Note that often Revit errors and warnings are misleading and unrelated to that actual issue.  There are a few topics on this on the revit api forum (such as this one). https://forums.autodesk.com/t5/revit-api-forum/nurbspline-creation-...

Thanks Jon I will take a look. I tryed this with 1 extra in front and in the end but i have still probs with some Curve definitions ... I will update the Issues

List<double> KnotsNew = new List<double>();
            KnotsNew.Add(knots.First());
            KnotsNew.AddRange(knots);
            KnotsNew.Add(knots.Last());


Thanks Jon.

Yes, Revit has a constrained capability with regards to nurbs (Such as your note above about degree 2, or the number of control points).

The Geometry Gym Revit plugin rebuilds a hermite spline by fitting points in the case that direct conversion fails.

I already decomplied Grevit to look for the solution. It just uses the Weight and Points no complex Curves with knots are implemented.No solution yet....

Well the few times that I needed to convert between Nurbs in other applications and Revit i used what Jon has advised. Basically check if curve is degree 3 and has the right amount of control points etc. If direct conversion failed I always reverted to using an approximation using Splines. Note that splines and nurbs in Revit are limited since they can't be closed for example hence there is no way to use them for such simple operations as profiles for extrusions etc. Revit has a very limiting geometry library that is not compatible with any other standard out there. Sorry mate. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service