Saving a compsolid object

Hi all,

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.

Many thanks,
Dan

Qr Qr's picture

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.

Daniel Woodman's picture

Many thanks Qr Qr.

I added the following line in the beginning of the code:

Interface_Static::SetIVal("write.step.nonmanifold", 1);

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.

Thanks again,
Dan

Qr Qr's picture

Can you share your CAD part as *.brep file?

Daniel Woodman's picture

Sure, here they are:

  1. tetrahedron-slice-0.stp: with write.step.nonmanifold = 0
  2. tetrahedron-slice-1.stp: with write.step.nonmanifold = 1

Just realised I made a wrong statement in my earlier post. Even in the first file actually the sub-shapes (vertices, edges, etc) are not shared between the solids.

Many thanks,
Dan

Daniel Woodman's picture

Sorry I just realised that you asked for a BRep file. I'll be right back with the file.

Daniel Woodman's picture

Here is the BRep file.

Many thanks,
Dan

Attachments: 
Qr Qr's picture

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.

Daniel Woodman's picture

Hi Qr Qr,

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.

Dan