read STEP file and export NURBS surface information

kevin

Looking around for some CAD
I would like to use opencascade to read external CAD files (such as STEP etc) and export all the surfaces as NURBS surface to some external self-developed tools for visualization and intersection calculations. I have some troubles of geting the trimmed information on NURBS surface.

I assume Analysis Situs may also used similar methods for file import, is there any reference codes i can find in AS?
 

Quaoar

Administrator
Staff member
Hello @kevin,

Do you need to convert all the analytical surfaces to splines? Can this be of some help? http://quaoar.su/blog/page/convert-cad-faces-to-splines-with-opencascade

Note though that generally speaking all the surfaces have to be trimmed. That's because NURBS is basically a four-sided surface that cannot represent everything unless properly trimmed. If you elaborate a bit on your workflow, it would help. E.g., why won't you export meshes?
 

kevin

Looking around for some CAD
Hello Quaoar,

I would like to have accurate intersections between incoming lines and the NURBS, this is normal for accurate rendering etc. If I export meshes, the intersection will not be accurate. Do you see any problems during this transform?

I need to convert all the analytical surfaces to trimmed spline surfaces. The artices you mentioned above doesn't have any information on the trimmed curve aspect. Do you have any information how the trimmed curve loop can be extracted using opencascade?
 

Quaoar

Administrator
Staff member
I need to convert all the analytical surfaces to trimmed spline surfaces. The artices you mentioned above doesn't have any information on the trimmed curve aspect. Do you have any information how the trimmed curve loop can be extracted using opencascade?
I would definitely start from ShapeCustom::ConvertToBSpline() and debug into it trying to understand why straight lines are not directly converted to spline curves. I mean, this thing works in the sense that it gives you a spliny box:

1642759100830.png
Have you tried it? Btw, you might wanna just explore the result of this conversion with TopExp_Explorer and convert each straight edge manually. Sorry, I'm just not sure how familiar you're with the library and if all these TopExp explorers sound clear enough or not.
 
Top