Related pages

Saving a compsolid object

I wanted to know if OpenCascade supports saving a compsolid object to a file. I made a compsolid from two solids which are the result of slicing a tetrahedron with a plane using BOPAlgo_MakerVolume (I understand that the result is a compound, but I extracted the solids from it), and tried to save this compsolid with both the Step and IGES processors. Loading these files in the CAD Assistant, I always got 1 compound, and 0 compsolid. The Step file is better here because some wires and faces are shared by the two solids, but still the stored object is a compound.

Not sure about compsolid (there is probably no such type in STEP, at least, I have never heard of such), but you may want to try activating read.step.nonmanifold and write.step.nonmanifold parameters of OpenCascade to switch STEP translator to a non-manifold mode. Internally, it will use non_manifold_surface_shape_representation entity (NMSSR, http://www.wikistep.org/im/jsdai/SAic_non_manifold_surface/Non_manifold_...) which is a dedicated type for such geometric structures.

and the result is actually one compound containing another compound, which in turn contains all the underlying, non-shared (i.e. duplicated) shapes. Not sure if I am doing this correctly, so I would appreciate any suggestion on this.

I have tried to save and open your brep using non-manifold writer and reader. Sharing of edges is preserved. Compsolid entity is indeed lost, but sharing is not. There are three shared edges and one shared face (8 faces in total). I am not sure I understand your problem.

Really sorry for this terribly delayed response, preoccupied by other tasks in the last few days.

Many thanks for pointing out the BRep format, I just checked it and indeed it stores the model as a compsolid, inclusive of the shared subshapes. I think that's what we need.

Basically I would like to pass a file containing our model as a compsolid to a colleague for further analysis. Initally we were considering the STEP format, but we learnt that it didn't have a compsolid capability. Seems like the BRep format is the way to go.