DiscussionsIssue archiveData Exchange and Application Framework

Forum archive

Data Exchange and Application Framework

Technical discussions preserved from the public OCCT community forum.

Topics
496
Replies
1,661
Files
533

Discussions

Page 1 of 9

Showing 60 discussions, ordered by the latest archived activity.

Using new export GLTF edges functionality

Hello, I updated to the latest master branch, and am trying to save STEP files as GLTF, which would would include the edges (as was implemented here ). The way I'm doing this is by opening the document, meshing with BRepMesh_IncrementalMesh , then saving with RWGltf_CafWriter::Perform . I tried open

12 replies3 files

The slow import of STEP files and high memory usage in OCCT 7.9.0

I imported a simple STEP (KUKA Robot) using OCCT7.9.0, but it takes at least ten minutes each time, and sometimes the memory exceeds ten gigabytes. According to research, OCCT can fix the iteration problem caused by shape, but I use DE_ShapeFixParameters fixParams = DESTEP_Parameters::GetDefaultShap

1 reply

Hide and Display AIS_ColoredShape - C# Wrapper

I am loading xml files to be displayed in the screen. The xml defines shapes and colors, so for creating the object, I am using a TopoDS_Compound and an AIS_ColoredShape so each part of the shape can be displayed in a different color. Also, I'm trying to use OCAF for displaying a complex structure a

5 replies2 files

how to make a customized TDF_Attribute persistent ?

I am using OCAF and have written a class that inherits from TDF_Attribute. I want to make it persistent (save it to an XML file). I have also written a class that inherits from XmlMDF_ADriver. I am using XmlXCAFDrivers::DefineFormat(mApplication) to register the format, but it doesn't work. How can

0 replies

Missing Presentation PMI in STEP Export with STEPCAFControl_Writer

Hello everyone,I am working on exporting STEP files based on OCCT. After using STEPCAFControl_Writer to export PMI data, the exported file only contains semantic PMI but no presentation PMI. Why is this happening? Could it be due to incorrect parameter settings, missing code for exporting presentati

4 replies1 file

TPrsStd_AISPresentation SetSelectionMode doesn't work

this is code in .\samples\OCCTOverview\code\OcafSamples.cxx in the repository // Get the TPrsStd_AISPresentation of the new box TNaming_NamedShape Handle(TPrsStd_AISPresentation) anAisPresentation = TPrsStd_AISPresentation::Set(aLabel, TNaming_NamedShape::GetID()); // Display it anAisPresentation->D

2 replies1 file

How to make two TopoDS_Shapes equal after deserializing with BRepTools::Read?

I have two solids that were processed with BRepAlgoAPI_MakeConnected. After the operation, some of their faces should be topologically identical—i.e., they should compare as IsEqual (or at least IsSame). However, when I serialize each solid separately using BRepTools::Write and then deserialize them

1 reply

What is the color space used in the XmlXCAF file?

AI and some googling told me that the color space in a XmlXCAF file is sRGB. But it seems not align with what I observed. I used CadQuery-OCP to create a simple box and saved it to a XmlXCAF file with a name and a color assigned to the box. box = BRepPrimAPI_MakeBox(10, 10, 10).Shape() theColor = Qu

2 replies1 file

Question: Free shapes missing when reading XCAF XML in PythonOCC

Hi everyone, I’m new to the OCCT community, so this is probably a dumb question, but I’m running into a puzzling issue. We have a C++ script that generates an XML/XCAF document from a STEP file. When we read back this XML in C++, everything works fine — the document has 1 free shape as expected. How

2 replies2 files

RWObj_CafReader crash when attempting reading .mtl file from an obj

Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication(); Handle(TDocStd_Document) anXCAFDoc; anApp->NewDocument("MDTV-XCAF", anXCAFDoc); RWObj_CafReader aReader; aReader.SetDocument(anXCAFDoc); Message_ProgressRange pr; aReader.Perform(filename.c_str(), pr); i have this part of cod

1 reply

Error importing vrml model

Hello, When I imported the vrml model, I obtain a mirror of the model. And you can see that the letters are in the opposite direction. I don't know how to solve this problem. Do you have any good suggestions? Here's my code to import vrml file: Handle(TDocStd_Application) m_app; Handle(TDocStd_Docum

9 replies4 files

Error while loading the vrml file.

I’m working with a VRML model and ran into an import issue using Open Cascade 7.7. My VRML file contains data like this: ``` MaterialBinding { value PER_FACE_INDEXED } Material { ambientColor [ 0.752941 0.752941 0.752941 ] diffuseColor [ 0.752941 0.752941 0.752941 ] emissiveColor [ 0.158118 0.158118

9 replies3 files

[STEP] Export multiple items under one product

Hello, I'm trying to export multiple elements (points, curves, surfaces) with a single product in the file, but I'm having trouble to achieve it. This type of hierarchy is possible since I have a sample file, saved by 3DExperience, that has this specific structure. I can read the target file and re-

2 replies1 file

problems while loading very large STEP files

I had very large a STEP file(64MB) to be loaded to a TopoDS shape and the loading took more than 6 hours. Anything I can do to improve it? The code I used: Archived image: external image

7 replies3 files

Received incorrect faces while loading IGES

chrono pload ALL NewDocument d XCAF ReadIges d "e:/old file/e/test/false_circle2.igs" DFBrowse d XShow d vsetdispmode 1 vfit When using the above script to load IGES, the small facets in the box become circular surfaces (missing the small facet part), and loading in CAD Assistant is not a problem, C

2 replies1 file

memory overrun in ToUTF8CString

Hola~ Not sure if this is the right place, but I am reading a STEP file and an XCAF document. I then use the XCAFPrs_DocumentExplorer and convert the node names from OCCT structures to std::string: for( XCAFPrs_DocumentExplorer i(anXdeDoc, XCAFPrs_DocumentExplorerFlags_None); i.More(); i.Next()) { c

5 replies

Cannot retrieve all colors from a STEP file using XCAF

I have been trying to build an Assimp mesh from a STEP file using the XCAF framework. Despite trying various methods to retrieve the colours, I am unable to obtain all the colours. What is the possible way to make sure that all faces are getting the colours correctly? I have attached the source code

1 reply4 files

Is it possible to reuse STEPControl_Reader for sequential reading of step files?

Hello, I was trying to reuse the same step file reader to read a second file. Surely the simplest would be to create individual readers but I'm curious if it is possible to reuse the same reader. This code throws at the second .TransferRoots(): // Read part1 and part2 STEP files STEPControl_Reader r

0 replies

Duplicate TDocStd_Document to apply changes

Hey, I'm making an application where you can import a STEP file, make modifications by removing labels and shapes and then save it back to a STEP file again. At the moment of saving I'm doing all the required modifications to the document using OCAF. The problem with that is that the original docume

2 replies

How to extract entity names using XCAF

It is a Vertex in OCC I need to traverse it with Document. Which API should I use to get the string I selected in the image? I need to extract it

2 replies1 file

StepWriter appends number to productname

Hello, I have an application that creates step files with productnames: std::ostringstream outputStream; STEPControl_Writer writer; Interface_Static::SetCVal("write.step.product.name", productName.c_str()); IFSelect_ReturnStatus transferStatus = writer.Transfer(shape, STEPControl_AsIs); if (transfer

1 reply

Cone surface cannot be triangulated

Good day, The attached step file contains a face made from a truncated Cone surface. It was originally part of a much larger and complex model. We are developing a software using OpenCascade 7.8.0, and when loading the model, we find that this face has a null triangulation. Our code loads the file u

2 replies1 file

step file conversion obj example

I wrote a demo according to WriteObj function. But it exits at RWObj_CafWriter.Perform() No errors are indicated. #include <TDocStd_Document.hxx> #include <TDocStd_Application.hxx> #include <DDocStd.hxx> #include <STEPCAFControl_Reader.hxx> #include <TColStd_IndexedDataMapOfStringString.hxx> #includ

25 replies

Exported PMI graphical presentation to STEP is not picked up by other CAD tools

When I export a STEP file with PMI data there is still something missing. The NIST step viewer and Autodesk Inventor don't seem to recognize the PMI data. If I load the exported STEP with my own code and try to find the relevant labels and attributes everything seems to be there. The only thing I th

2 replies1 file

How do I write a step with GDT's ?

I have the following code two create a shape and adding a dimension measurement to it: Standard_CString fname("somefile.step"); // create shape TopoDS_Shape box1 = BRepPrimAPI_MakeBox(100.0, 100.0, 50.0).Shape(); // Base box TopoDS_Shape box2 = BRepPrimAPI_MakeBox(gp_Pnt(100.0, 50.0, 0.0), 50.0, 100

1 reply

Solid Thickening a Selected Region from STL Using OpenCascade and vtkPolyData

I'm new to OpenCascade. I have a vtkPolyData generated by drawing over an STL surface, where only the inner region of the drawn area is preserved (the outer portion is removed). Now, using this vtkPolyData as input, I want to create a thickened, solid (non-hollow) 3D object using OpenCascade. The re

5 replies3 files

Import STEP file to Houdini

Hey, everybody! I am new to OCCT and just starting out. I am writing a node to import step file into Houdini. And there are some problems when working with XCAF Houdini doesn't want to accept the code where XCAFApp_Application::GetApplication() is initialized - it just won't load my dll. So it was d

18 replies1 file

How to fix: Nothing to transfer

When importing the attached STEP file using the following code, I encountered this error message. Neither FreeCAD nor CAD Assistant could import it correctly. However, strangely, some other CAD software (unrelated to OCC) managed to import it without issues. What could be the reason for this, and ho

2 replies1 file

Loading Partial STEP Files for Conversion to GLB?

Hi everyone, I'm working on converting STEP files to multiple GLB files using OCCT. One of my STEP files is extremely large (around 9GB), and my current machine isn't powerful enough to load the entire file at once. Is there any way to load only parts of the STEP file, such as specific sub assemblie

1 reply

Color loss of shape caused by transformation or SetShape

Hi. When making a sphere and coloring it, and then performing transformations (such as translation), the color will be lost. I have written a complete and executable minimal example program to reproduce this problem: #include <TDocStd_Document.hxx> #include <STEPCAFControl_Writer.hxx> #include <Inte

3 replies

OBJ Importing and Displaying

ok, apologies up front: I'm still figuring out OCCT and I'm probably being stupid... I'm trying to import and display an OBJ file, but failing at the first hurdle: Q1. ----- Do I use: 1. XDE 2. RWObj::ReadFile() 3. RWObj_Reader class? (using 7.8, aiming for latest-and-greatest support) Q2. ----- I'v

11 replies

the problem in the function machanism usage

I am trying to use OCCT's function mechanism to achieve real-time updates for parametric modeling. To start, I wrote a simple demo, but during the output testing of the demo, I found that regardless of whether I modified the attributes of an Attribute in a Label, the output information always showed

0 replies

How to set an optimized memory manager in the VS

Hi. How can I set an optimized memory manager in the Visual Studio environment? What I tried is adding "MMGT_OPT=1" in the preprocessor definition. But it does not make any difference in terms of performance when importing a super big STEP file (over 1GB). Should I add something inside the codes? Th

3 replies

STeP Importer stuck and hogging memory

Hello. I've got an issue importing a STeP model that I unfortunately cannot share. OC keeps consuming more and more memory until it's killed (aroung 40GB or so). I tried debugging it and I see the problem arises in the function CreateSolids (ShapeFix_Solid.cxx, line 248 in version 7.8.1). The code i

15 replies

I get incorrect shape in the process of importing step file

Hello Everyone: When I read the step file, What I got just like picture 1; What CAD Assistant got just like picture 2; there are two differences between the shapes I get and those obtained by the CAD Assistant: 1. There's an extra piece in the shape. Just like picture 3; 2. A solid reads and becomes

5 replies5 files

RWGltf_Writer Edge & Vertex Export

When using RWGltf_Writer , I am able to export glb files that contain one mesh entity per BREP face in my CAD models; however, it seems there is no support for encoding discretized BREP edges in the glb export, nor support for encoding vertices from the CAD models, despite the capability by the file

9 replies

Segmentation Fault When Converting STEP Files to GLB

Hi everyone, I'm converting STEP files to GLB using OpenCascade. However, I’m encountering a segmentation fault during conversion with certain STEP files. However, if I open the problematic STEP file in CAD Assistant and then re-export it, the resulting file converts without any issues. I ran gdb an

13 replies

How to export gltf with right texture UV

I have two qustions here I have set the UV for the shape, but it didnt work in the final glb file Is there any way to set textureMap for gltf, like what I do in Compute() by Graphic3d_Texture2Dplane. such as set texture Rotaion export gltf #include <AIS_TexturedShape.hxx> #include <RWGltf_CafWriter.

3 replies1 file

Best choice: XCAF or TObj?

Hi all, I guess its a common question and ive seen some posts on the topic, but i am wondering whats better to use for the specific purpose of building a CAD/CAM application. Basically we will have some CAD tools so the user can: cover holes, repair breps, remove features (chamfers, holes...) and cr

5 replies

UE5 Plugin - STEP to GLB with 7.9.0 Beta

I successfully integrated OCCT 7.9 to Unreal Engine 5 . My goal is implementing runtime STEP and IGES importer . But it can't be done in a short time (collision, materials, hierarchy). So, if I can convert STEP to GLB, it will solve our problems in short term beacuse UE5 has very powerfull GLB runti

5 replies1 file

Accuracy of Bnd_OBB on imported STEP model

Hello Community, I am trying to get a precise Oriented Bounding Box of a model I imported. The model i am working with has a rectangular base. The problem i am facing is that the OBB seems to be slightly rotated, making it a little larger than it should be and the Directions off by a few degrees in

8 replies1 file

How to read roughness information from a Step file

Hello everyone, I use the STEPCAFControl_Reader class to read the step file, I can read the size and tolerance information, but I can't read the roughness information, please have any way to read the roughness information and comment information

2 replies1 file

Crash on cleanup after reading Step file

I'm using the current master branch (d419776). After the fixes with Jemalloc and missing headers I am now able to build correctly. Running my application now mostly works, except for it crashing when it exits. I'm getting an assertion error on the Standard_Type destructor: Standard_Type::~Standard_T

11 replies1 file

OCCT 7.8.0 crashes on termination after reading a IGES file

After sucessfull reading a IGES file, my application crashes on cleaning up. Environment: Visual Studio 2022 Version 17.9.2 OCCT via vcpkg Windows 11 compiled with cpplatest Usage, IGESControl_Reader myIgesReader; myIgesReader.ReadFile ("c:\\temp\\filge.igs"); Crash in Standard_Type.cxx Standard_Typ

16 replies

Cyrillic error when export to STEP

Hello. When exporting to STEP, if there is Cyrillic in the file name, then these characters are replaced with hieroglyphs, how can this be fixed?

5 replies1 file

Disable STEPCAFControl_Writer Statistics on Transfer

How do I disable the output generated by STEPCAFControl_Writer.Write(<filepath>)? The output I am referring to looks like... ******************************************************************* ****** Statistics on Transfer (Write) ****** **************************************************************

2 replies

Writing edges in to step file

I want to write edges in to step file to so that when the file is read, they are read as edges and not compound shapes. This shows up in the hierarchy. Attached (desired.png) the desired hierarchy - Currently, I am writing it like this - BRep_Builder builder; TopoDS_Compound compound; builder.MakeCo

1 reply2 files

Parasolid Import Component availability

Hi, I'm highly interested in Parasolid Import Component. I filled the form under "Contact Sales" here: https://www.opencascade.com/components/parasolid-import-component/ and few weeks have passed without any reply. Should I assume that this is no longer available?

2 replies