DiscussionsIssue archiveData Exchange and Application Framework

Archived discussion

Saving a compsolid object

Data Exchange and Application FrameworkFri, 12/08/2017 - 15:308 replies

Browse this forum
QuestionAuthor

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

Discussion

8 archived replies

Posts are displayed in their archived order.

01Commenter-1

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.

02Author

Many thanks Commenter-1.

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

03Commenter-1

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

04Author

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

05Author

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

06Author

Here is the BRep file.

Many thanks,
Dan

07Commenter-1

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.

08Author

Hi Commenter-1,

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