keithsloan52 wrote: ↑
Mon Mar 30, 2020 7:24 am
microelly2 wrote: ↑
Mon Mar 30, 2020 6:26 am
keithsloan52 wrote: ↑
Wed Mar 25, 2020 6:18 am
Question: Does Silk just deal with NURB Surfaces? or can it do other types of surface, like Bezier etc?
What about the other Surface related workbenches.
i.e. Which workbench should I be taking a fork of and trying to add an importer using OpenNURBS?
At the end you always have BSpline surfaces and BSplines curves as border for patches.
For both datatypes there are classes in FreeCAD.Part: BSplineSurface and BSpline Curve
These object are full featured Nurbs and they are full parametric.
Beziers are a special case of BSplines, So IMO there is no need to have Beziers as background data model.
You can write your importer in a separate workbench or modul, so we can in stall it and use it in other workbenches.
Well Chris_G has written the code for a NurbsSurface and I adjusted his attempt for a NurbsCurve, When I import a file with these components they display, but if I select them I don't see any relevant properties in FreeCAD's property window, so not convinced we are doing things correctly.
github repro is at https://github.com/KeithSloan/ImportNURBS
Sample 3DM files are available at https://www.rhino3d.com/download/openn ... bs6samples
Test file for surfaces is V6 - mysurfaces.3dm
Test Curve is V6 - mycurves.3dm
basically all surfaces in freecad have full nurbs functionality. it's the core. what ChrisG, Microelly, and myself have done is based off of the existing objects. we just go about it different ways. if you have an external nurbs object you want to import, you need to figure out how to read its knot vectors and pole/weight tables. then feed them into the freecad objects. it gets trickier with trimmed surfaces, but it's all there.
the reason we have all these different tools is because the core nurbs object doesn't tell you how to go about creating the knot vectors, poles, etc.
but if you're importing, it's just a translation exercise (at a first glance, i'm sure there'll be some puzzles)
edit: as far as editing the imported objects....you can already use the python console to read the existing pole tables, edit them and create new modified objects....but that feels more like trying to model with chewing gum than it feels like modeling with clay.
if you don't have access to the underlying curves and the tools that were used to generate the surfaces, you end up with a challenge similar to, for example, editing a step object without the modeling history.