mcneel / rhino.inside-revit

This is the open-source repository for Rhino.Inside®.Revit
https://www.rhino3d.com/inside/revit/
MIT License
247 stars 65 forks source link

Surface will not translate as BREP to Revit #175

Open scotttd opened 4 years ago

scotttd commented 4 years ago

This surface will not import through RIR as a Directshape BREP surface. When used it translates to a mesh. What is interesting, if I use the Rhino3DM importer into Revit then it does import as a BREP.

Steps to reproduce the behavior:

  1. Used a BREP param and a GeometryasDirectshape component to input the BREP.
  2. The result is a Mesh.

If I restart Revit, then use Insert CAD in Revit and import the 3DM file, it is a BREP

Why is it different?

Related To

eirannejad commented 4 years ago

Investigated this in Revit 2019 Confirmed the example patch is converted to directshape mesh

Screen Shot 2020-03-02 at 17 14 02

Native Revit imported, imports the surface (haven't verified if it makes any changes to the surface)

Screen Shot 2020-03-02 at 17 15 50

Native Revit import, builds a DB.HermiteFace from this geometry:

Screen Shot 2020-03-02 at 17 33 57

scotttd commented 4 years ago

Interesting. This is from part of a Rhino SUBD object.

The 9 point degree 3 patches what to be hermites. I wonder if all Subd Patches are Hermite?

Looks like the 7 point degree 3 patches along the edges will work with the standard BREP translation.

eirannejad commented 4 years ago

Investigated this a bit more. Revit API does not have Nurbs implementation so any surface other than the known topologies (Conical, Cylindrical, ...) is going to be created as a Hermite Surface

Screen Shot 2020-03-03 at 14 01 08

A simple rebuild on the Nurbs patch given in the example file above (to the exact matching # of control points) will cleanup the surface definition and Revit can actually understand the surface data and correctly create a HermiteSurface

Screen Shot 2020-03-03 at 14 00 00

We need to investigate and see what are the differences between these two surfaces:

SubD-PatchV6_edited.3dm.zip

Comparison Results

Confimed comparison results from McNeel mathematicians:

The surfaces have IDENTICAL NURBS structure (degree, counts, ... ). The ONLY differences are ones that should not matter.

Use the list command to see the knots for one surface are 0,1,2,3,4,5,6 and for the other surface are 0, 1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 1

Seems like we need to focus on fixing the know scaling before passing the geometry to Revit.

kike-garbo commented 4 years ago

I tried normalizing the knots and doesn't work either.

Testing this I noticed that surfaces here SubD-PatchV6_edited.3dm.zip are like:

Rhino surface:

Revit Surface:

kike-garbo commented 4 years ago

Those surfaces are a bit special, The technical issue is the two first partial derivatives are nearly parallel, and this produces numerical instability at the rounded corner of those surfaces. This is very rare in typical NURBS, but may happen in NURBS that come from a SubD.

eirannejad commented 3 years ago

Tested this with the most recent Rhino.Inside.Revit and issue still stands