Import points from step file

ilpup

CAD practitioner
Hello,

it seems to me OCC can't handle points from step file.

So TopAbs_VERTEX is never found, and something like this never happens:

if (shapeTool->IsShape(label))
{
TopoDS_Shape shape;
shapeTool->GetShape(label, shape);

if (shape.ShapeType() == TopAbs_VERTEX) {
std::cout << " VERTEX FOUND" << std::endl;
}
}

I put an example file Part6.stp and the generated views with catia, rhino and OpenCascade.

Not to mention, planes and axis systems are not handled too.

Do you have any suggestion ?

Thanks
Domenico

CNEXT_2022-01-28_08-47-15.png

Rhino3_r5VaK3Iprb.png
OpenCAscade_2022-01-28_08-49-45.png
 

Attachments

  • Part6.stp
    13.6 KB · Views: 1

natalia

Moderator
Staff member
OCCT handles points from this STEP file. These points are read from the STEP and exist in OCAF document.
You're not found them because they are placed in a compound.
Try to find this kind of topology and get vertices from it.

Let's check the points in Inspector tool of OCCT:
inspector_step_points.gif
Steps presented in the attached video:
1. import STEP file
2. check which shapes exist in it. Found, that one of the shapes is a compound with points
3. click on the compound shape and check which label contains it
4. select the source shape in properties view, click on it
5. export the shape into 'ShapeView' plugin of the Inspector
6. investigate the shape using its tree
7. check that this compound contains vertices
8. activate again 'DFBrowser' plugin of the Inspector to find constructive presentations
9. open the document labels to check attributes related to constructive geometry. There is no information about such kinds of presentations.


Regarding planes and system coordinates. We checked that this prepared OCAF document has no attributes with this information.

Some investigations above it, as it's interesting whether OCCT may or not processing these STEP items.
These elements, according to STEP attached, are the constructive geometry:
Code:
...
#34=PLANE('Plane.1',#33) ;
...
#40=CONSTRUCTIVE_GEOMETRY_REPRESENTATION('supplemental geometry',(#34,#201,#208),#16) ;
...

OCCT Step reader processes it when performing reading this file into internal structures (entities).
We may check it in the code of RWStepRepr_RWConstructiveGeometryRepresentation::ReadStep() and debug it when importing this STEP file.
It goes here in this place and read them.
So, these elements are inside the internal structures of STEPCAFControl_Reader when the STEP file is read.
If we need we may get these elements from the reader.

Later, the usual way of using this reader is to fill a new OCAF document by it. It happens by rows similar to:
C++:
  Handle(TDocStd_Document) aDocument;
  aTmpApplication->NewDocument ("BinOcaf", aDocument);
  aStepReader.Transfer (aDocument);

On this step, OCCT doesn't process these constructive geometry representation entities and as a result, we have no this information in the new document.
Maybe it's a rare case that they are needed or this transfer is on the way to the new version of OCCT?
Anyway, it seems that we have access to these entities by the reader and may fill some attributes in OCAF document for them by ourselves, or put them into other structures that we need, don't we?
 

ilpup

CAD practitioner
Thank you Natalia for your very detailed explanation! Ok, so for points it is clear what I missed.
I got any insights while debugging RWStepRepr_RWConstructiveGeometryRepresentation::ReadStep() but probably I need a deep dive into OCCT source code which I don't have right now...
 
Top