Mesh to Nurbs - unify coplanar surfaces

Hi All, I have a model consisting on thousands of mesh models of buildings making up a city model. What I am trying to do is convert these mesh models to simplified nurb surfaces, where co-planar triangles are unified therefore minimising the number of surfaces.

Currently, I am using a macro by @pascal which seems to work fine for processing 70-80% of the geometry but it is failing when it gets to a certain stage and I believe it has an issue when trying to merge co-planar surfaces which have a too grater angle of change.

Macro:

Weld Pause 10 Enter Enter

SetRedrawOff

SelNone SelLast

Explode DupBorder

SelNone SelLast

PLanarSrf SelNone

SelLast Join

SetRedrawOn

Are there any changes that can be made to the macro to avoid this issue or are there any scripts that can rebuild simplified nurbs models from mesh models?
Below is any image of the results from the macro I have been using to convert the mesh models.
Cheers,

Hello- can you please post a model that has one or two examples of that macro failing?

-Pascal

Hi Pascal, please see the model attached where the macro is failing.
Cheers,
Michael
Sample-MacroFail.3dm (8.5 MB)

Hi Michael - it seems to work on sets of faces that are planar and fail on ones that are not - that is expected. Several of these meshes are not planar where you might expect them to be.

-Pascal

Hi @pascal, yes that is what I thought was occurring. I guess there is no quick fix for this type of issue, as it is a geometrical issue not a software/processing issue…
Many thanks for the quick response and input!
Cheers, Michael

Hi @pascal, my second thought is, could the macro run and covert as many coplanar surfaces, and then when they are not coplanar it revert back to rebuilding the mesh triangles as nurbs surfaces? Look forward to hearing from you! Cheers, Michael

Hi Michael - try

_SetRedrawOff
_ToNurbs _Pause _Enter
_SelNone _SelLast
_MergeAllCoplanarFaces
_SetRedrawOn

-Pascal

Thanks for the input @pascal, it has an issue with “_ToNurbs” as it states “Unknown command”…

Hi Michael - in V5 try

_SetRedrawOff
_MeshToNurb Pause Enter
_SelNone _SelLast
_MergeAllFaces
_SetRedrawOn

merging may be slow in V5 but that should work

-Pascal

Hi @pascal, this appears to be working perfectly. The issue is now how long the compute time is taking, in some cases it is taking up to 2 hours to convert a single building… Is there any way to use this macro and batch automate the conversion of thousands of individual mesh files? And would it be something that could be process using a thread ripper to speed up the processing time?

What’s the benefit of converting the meshes to nurbs in this case?

They are a batch of models that have been produced in MicroStation and our client requires them as nurb models for processing through Rhino-InsideRevit.

1 Like

Hi Michael - in V7, on all the objects in the file you sent, the macro takes about a second.

-Pascal

Wow, it is a lot faster in v7! This is working perfectly, many thanks for the assistance Pascal.