This indeed generates semantic DATUM/DATUM_FEATURE entities in the STEP file which is great! However I also want to add the visual representation of the datum to the file. With the triangle and datum letter and all. How can I do that? Are the StepRepr_* classes used for that?
Discussion
6 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hello. Adding a pre-tessellated representation is available for export to STP from XCAF.
It can be done by Handle(XCAFDimTolObjects_DatumObject) stored in XCAFDoc_Datum. Check XCAFDimTolObjects_DatumObject::SetPresentation.
The limitation: the presentation must be mesh. TopoDS_Face or Wire/Edge. No solids.
Best regards, Commenter-1
02Author
Thanks for the quick answer! I'm trying something like this:
Handle(XCAFDimTolObjects_DatumObject) datumObject = datumAttribute->GetObject();
datumObject->SetDatumTarget(face);
datumObject->SetDatumTargetType(XCAFDimTolObjects_DatumTargetType_Area);
datumObject->SetPresentation(face, new TCollection_HAsciiString("test"));
datumAttribute->SetObject(datumObject);
But doesn't seem to change the resulting STEP file. What am I missing?
face is a TopoDS_Face.
03Commenter-1
Hello, I'm no sure about what missed. Looks fine. But only SetDatumTarget should be not the same as a presentation. Presentation must to be meshed (Should have triangulation). the schema must be AP242.
For now please check that XCAF was changed and label was added to the tree. You can use Inspector to validate XBF changes (tree changes).
Best regards, Commenter-1.
04Author
Thanks again, but I'm confused, sorry. What does the shape argument of SetPresentation do? What I want to achieve is to export the visual representation of the datum in the STEP file (for example attached visually to the face). I don't have such a visual representation - I'm asking for a built-in/standard one.
PS Yes, I use AP242.
05Commenter-1
Creating of PMI as a shape is not a part of open source. I can only recommend to check FreeType and StdPrs_BRepTextBuilder to generate the text and then generate the contour according to the ISO.