import IGES or STEP
error!!!
@claymonkey iges import is tricky as you have to know and specify the type, and even then it can have problems if the data is not clean -- there are lots of iges exporters that export junk.
with step import, the most common cause is trying to import something that is not ap203e1 -- that's all that's presently supported. some like ap214 or e2 are also common.
I tried to use the reading method of OpenCaseCAD to parse IGEs. However, it was very troublesome to convert all faces into NURBSface+NURBScurve logic. Especially when I wanted to translate the type into other BREPS models, the speed was very unsatisfactory. This reminded me of the BREPS structure in the current software, but errors frequently occurred when I tried to import it.
@claymonkey what is your use case, end goal?
(deleted)
Try to parse the CAD file by yourself and convert it into a creatable BREP type.
@claymonkey so just for the technical challenge? or some other purpose? parsing and converting from iges/step to some brep in-memory structure is not exactly an end-use case..
If you're working with BRL-CAD, the 3dm-g is by far the best brep import method that imports faithfully & natively using OpenNURBS. Next best is step-g if it's an ap203e1 file. The iges-g importer hasn't been tested or used in production use for nearly a decade, but it has extensive code for multiple import methods and encoding types (including automatic re-encoding of bspline to NURBS) but also less reliable if there are any errors in the geometry.
Because I found that the Brep type of openNurbs is quite similar to that of opencascad, when some programs do not support certain operations, I thought of using the underlying feedback information to create corresponding ones, hoping that other open-source methods can handle them more precisely.
It is indeed similar, but not 1-1 identical if memory serves.
so are you looking to bridge geometry from some application built on opencascade into brl-cad, to some operation that brl-cad handles better, and then convert it back?
Yes, if multiple software functions are combined, then only common cad types can be used for conversion. After all, brep will not be exactly the same
that would certainly be feasible for brep and/or polygonal types I'd think
problematic encodings are typically: implicits, csg booleans, volumetric/voxel data, level sets, subdivision surfaces, t-splines, medial axis, signed distance fields, and parametric ops like sweep/loft/extrude
brep is more amenable, includes triangles, polygons, bezier patches, b-spline patches, and nurbs surfaces
Perhaps FACE can be parsed as a combination of the basic NurbsSurface and CurvesToTrimed
. Then perhaps in any logic, there will be corresponding creation methods.
There was some work done a while back on opennurbs -> opencascade, IIRC - I think it was this? https://www.cnblogs.com/opencascade/p/opennurbs2opencascade.html
I recall hunting around a while back because going to/from opennurbs and opencascade data types would be a keystone of a converter of .g geometry to/from FreeCAD
It would be really awesome if we had two way communication with FreeCAD, but my recollection is that the problem is fairly involved - NURBS BRep objects have a LOT of subtypes, and there are subtleties that need to be taken into account.
Last updated: Jun 27 2025 at 00:56 UTC