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 2 of 9

Showing 60 discussions, ordered by the latest archived activity.

Remove label from OCAF results in shape not removed

I'm trying to remove a label with a shape from the OCAF document. The structure without any modifications is the Archived image: external image Then I'm going to remove PLATE by calling RemoveComponent on label 0:1:1:1:1. Then the structure looks like this and you can see that PLATE has moved up: Ar

1 reply3 files

Export visual representation of a datum to STEP file

Hi, I'm trying to write a STEP file and add a datum to a face. I use the following code: Handle(XCAFDoc_DimTolTool) dimTolTool = XCAFDoc_DocumentTool::DimTolTool(doc->Main()); Handle(XCAFDoc_ShapeTool) shapeTool = XCAFDoc_DocumentTool::ShapeTool(doc->Main()); TDF_Label datumLabel = dimTolTool->AddDa

6 replies

How to extract descriptive representation item of a shape entity

Hello, I am currently working with the 7.8.2 dev C++ version and Visual Studio 2022 to extract meaningful data from STEP files and convert it into other formats. As shown in the image below, some STEP files contain a line(s) with an MEASURE_REPRESENTATION_ITEM command. I intend to extract data defin

3 replies4 files

STEPControl_Reader Access violation reading location

Good morning, I'm encountering an issue with the STEPControl_Reader in my program: The program starts by creating a concurrent queue. The queue items consists of file paths. After the queue has been created, i create 16 worker threads that consume the queue items. The work each thread does, consists

15 replies3 files

How to read UDA data by latest OCC7.8.0

Hello, I ues the sample given in the "New feature - STEP Import | User Defined Attributes", code as: Handle(TDocStd_Document) aDoc = new TDocStd_Document("MDTV-XCAF"); Standard_CString filename = "E:\WorkSpace\metadataFile.stp"; STEPCAFControl_Reader reader; reader.ReadFile(filename); if(reader.Tran

10 replies6 files

BRepMesh_IncrementalMesh doesn't triangulate conical face coming from a step file

Hi All, I'm using OCCT 7.8.1 to import and tesselate STEP files. Overall everything works great, but there are a couple of files where parts of the file can't be triangulated. See the attached test.zip file for an example step file. I'm using BRepMesh_IncrementalMesh mesh (shape, 0.01, Standard_Fals

0 replies3 files

CSharp Import IGES Export OBJ

Hi, new here. I've been trying to do some format conversions based on what CAD Assistant can do. I've done some tests using the CSharp sample but I can't do the OBJ conversion as it doesn't appear in the enumeration (BREP, STEP, IGES, VRML, STL, IMAGE). Do I need to update the OCCTProxy or is the OB

6 replies

Reading colours from a STEP file with GetColour returns incorrect RGB values

Reading colours from a STEP file with GetColour returns incorrect RGB values. I use the GetColour method to read the RGB values of surfaces. However, these are not determined correctly. Here is the code and the step. Do I still have to convert the values returned by open Cascade? The following colou

2 replies1 file

Map StepShape_ManifoldSolidBrep to TDF_Label/TopoDS_Shape while importing step file

I am trying to import STEP file and trying to classify 'CUT' and 'NOCUT' bodies. I have attached the step model. The issue I am facing is with reliably being able to identify those bodies. In different STEP files, different STEP entities are named as 'CUT' and 'NOCUT'. E.g. 'PRODUCT', 'NEXT_ASSEMBLY

4 replies3 files

Bug in TCollection_AsciiString.cxx

Hello, try the following code with OCCT 7.8.1: TCollection_AsciiString UIDStr("{EE1F6ED0-3EBF-4313-9F6D-188BEF85847D}"); UIDStr.RemoveAll('{', Standard_True); UIDStr.RemoveAll('}', Standard_True); CString UniqueDirName = UIDStr.ToCString(); UniqueDirName holds: "EE1F6ED0-3EBF-4313-9F6D-188BEF85847D}

1 reply

Force use of PRESENTATION_STYLE_ASSIGNMENT

I am trying to read a step file by colouring some faces and saving the coloured file. However, I have noticed that very often the colours are handled with PRESENTATION_STYLE_BY_CONTEXT generating compatibility problems with some software (e.g. FreeCAD, Fusion - using CAD Assistant works). Trying to

1 reply

What to be included to import and export IGES and STEP whith 7.8.0

Hi there, I'm trying to import some STEP and IGES files using OCCT 7.8.0. I know the module has been redesigned. So, in my pro file (I'm using qmake) which LIBS need to be included? I'm using the official binary. I don't have TKDESTEP, TKDEOBJ, TKDEIGES, TKDEGLTF, TKDEVRML, TKDEPLY, TKDESTL in my li

2 replies

[SOLVED] invalid use of incomplete type ‘class XCAFDoc_ShapeTool’

Hello, I've been reading the documentation and many example from the forums, and I can not understand why the following code is failing: Handle(TDocStd_Document) new_document = new TDocStd_Document("step-caf-reader"); Handle(XCAFDoc_ShapeTool) shape_tool = XCAFDoc_DocumentTool::ShapeTool(new_documen

4 replies

How to get vertices coordinates of each triangulated face of a shape

Hello, I tried getting feedback from another question I posted here, but I think it was with a wrong approach, and therefore I'm asking it in a different way: For an application that I'm developing, I need to get the coordinates of all three vertices of each triangulated face of a shape. The steps t

2 replies

Duplicate faces in STEP file import

Good day, I am attempting to load STEP files using the STEPCAFControl_Reader class. I have a file ("KopieOrig.STEP" in the attached zip file), which has been exported from SolidWorks 2013 using the AP214 format, containing two solids. Each solid has some faces which are colored. When parsing the fil

4 replies2 files

Extracting Descriptive Representation Item from STEP File

Hi! I've been digging through an AP242 file and haven't been able to extract a certain descriptive representation item. The step file is attached, I'm looking for entity 22256: #22256=DESCRIPTIVE_REPRESENTATION_ITEM('','NOTES... I've tried traversing with the XCAFDoc_NotesTool, _ViewTool, _LayerTool

1 reply1 file

Save a .step by tdf_label but wrong location

I got a assembly .step file and i want save a part of them. My code: void GetAssemblyShapes(const TDF_Label& label, std::vector& vecAssemblyShapes,Handle(XCAFDoc_ShapeTool) aShapeTool){ if (XCAFDoc_ShapeTool::IsAssembly(label)) { for (const TDF_Label& child : shapeComponents(label,aShapeTool)) GetAs

2 replies1 file

STEPControl_Reader display other shape

I am using OCCT version 7.6.1, and after reading the STEP file, the displayed model is incorrect; it changes from a set of line segments to a polyline. I have tried setting read_precision_mode and read_precision_val, but it still doesn't work. How should I configure it to display correctly?

1 reply3 files

Exporting GLTF/GLB With Extra Data

Hello! I am currently working on a project that requires my team and I to insert some metadata into the "extras" section of the GLTF. We were able to find a way to do this by altering the RWGltfCafWriter.cxx file but we know that's not a scalable solution. Our solution utilized the RWGltf_GltfOStrea

7 replies

STEP AP242 Reading and Meshing Errors

Hello everybody, I'm currently facing a critical issue with a simple step file in ap 242 file format, created in SolidWorks. The program crashes without any helpful error description when I try to mesh it with BRepMesh_IncrementalMesh. This problem persists with other software built on top of occt,

1 reply2 files

STEPCAFControl_Writer not writing the SubShape data like Names and Colors

I am working on importing a STEP file and then exporting it back but changing their appearance using color and material. I am able to export color information for Compounds and Solids but when I try to do it for Faces it doesn't export. I have verified that the face label created has the color infor

0 replies

No names in STEP file when writing in non-manifold mode

Hi, in the example below shapes are written to STEP file and a name for the shape is set (written off the top of my head): // read shape from BREP BRep_Builder b; TopoDS_Shape aShape; BRepTools::Read(aShape, "C:/temp/shape.brep", b); // write shape to STEP STEPCAFControl_Writer aWriter; Handle(TDocS

2 replies1 file

Slow performance of STEPCAFControl_Reader in webassembly vs. Windows

Hello OCC Team, I have observed a significantly slower speed when using the ReadFile and Transfer functions of STEPCAFControl_Reader to read STEP files in webassembly compared to Windows. This is my code: STEPCAFControl_Reader aStepReader; aStepReader.SetColorMode(true); aStepReader.SetNameMode(true

3 replies1 file

Issue with Reading IGES File Generated by ProE

Subject: Issue with Reading IGES File Generated by ProE Hi everyone, I'm encountering an issue with reading an IGES file that seems to have been generated by ProE. When I import the file, it appears that surfaces are also being imported as shapes, which is not what I expect. To verify this behavior,

2 replies5 files

Read Step file and correct location of parts

Dear all, I'm trying to read a Step file and retrieve the correct location and colour of each of the parts. I found a snippet of code ( https://github.com/tpaviot/pythonocc-core/blob/master/src/Extend/DataExchange.py ) and implemented in my code. I'm attaching my code in text format, as the forum do

0 replies1 file

I can read the color of solid, but not the color of face from step files

I exported a model to the step file. I use aColorTool->SetColor(aLabel,surfcolor,XCAFDoc_ColorSurf); Save solid and face color information. Then I import this step file that I use aColorTool->GetColor(aLabel,XCAFDoc_ColorSurf,surfcolor); Read solid and face color information. The weird thing is, I c

9 replies1 file

Stuck at STEPCAFControl_Reader::Perform when reading a Stp file (OCCT 7_8_1)

Hi Usually, I read STP files using STEPCAFControl_Reader , and most of the files work without any issues. However, when I try to read the STP file from the link, the program gets stuck at the STEPCAFControl_Reader::Perform . Could the development team help investigate the issue? The STP file can be

2 replies

Extract hierarchy / tree of products

I want to import a STEP-file using OpenCascade. The file comes from a CAD program, in which a hierarchy of components is represented, e.g., I have a root component, underneath several other components, and under those several sub-components, and so forth. With the following code, I am able to get al

0 replies

Keep Face Labels after rotating object

Hello! I created the following function that can rotate a model and save it to step. def rotate_model(file_dir, file_name, axis): # set reader reader = STEPControl_Reader() reader.ReadFile(file_dir+file_name) reader.TransferRoots() shape = reader.OneShape() treader = reader.WS().TransferReader() top

2 replies

Issue with Retrieving Block Names from IGES Files Using OCC

Dear OCC Community, I hope this message finds you well. I am currently working on a project where I need to read IGES files using the Open Cascade (OCC) library. I have encountered an issue regarding the retrieval of block names from these files. Problem Description: While using OCC to read IGES fil

1 reply

I could not read advanced_brep_shape_representation's name from step files

I have a step file with many parts in it. These parts have names, as shown in Figure 1, stored in the advanced_brep_shape_representation. But I don't know how to get the names. I used the CAD Assistant to read this file, and the result is shown in Figure 2. The CAD Assistant also couldn't read its n

5 replies3 files

Reduce complexity .stp files

Hey Everyone, We are currently testing the collision detection (COL-DET) component of Open Cascade. However, we're facing performance issues when processing large and complex .stp files; the results are taking too long to generate. Despite the collision detection component being a paid feature with

6 replies

Resetting the transformation will collapse the object into the origin.

Imported the step model and display in the viewer using following code Handle(TDocStd_Document) anXdeDoc = reader->doc; Handle(AIS_InteractiveContext) theCtx = m_pAISContext; Handle(V3d_View) theView = m_pV3dView; for (XCAFPrs_DocumentExplorer aDocExp(anXdeDoc,XCAFPrs_DocumentExplorerFlags_None);aDo

4 replies1 file

Unable to import an OBJ model with an associated MTL material file

I want to load an OBJ model with an MTL material, so I included the necessary headers: #include <RWObj_Material.hxx> #include <RWObj_MtlReader.hxx> But when I declare the variable: NCollection_DataMap<TCollection_AsciiString, RWObj_Material> aMaterials; RWObj_MtlReader aMtlReader(aMaterials); The co

7 replies

"STEPCAFControl_Reader::Transfer" doesn't read anything.

Hi. I used "STEPCAFControl_Reader" to read a step file, but it doesn't read anything. Basic Infomation: Version: 7.8.1 Debug Information: ReadColor: true, ReadName: true, "STEPCAFControl_Reader::ReadFile" return "Ok" "STEPCAFControl_Reader::Transfer" return "true",but it output message "Microsoft C+

9 replies3 files

fails to read a STEP file (OCCT 7.7.0)

I attempted to read a STEP file using STEPCAFControl_Reader, but the program crashes when I call the Transfer. My current code is as follows: Handle(XCAFApp_Application) hApp = XCAFApp_Application::GetApplication(); Handle(TDocStd_Document) hDoc; hApp->NewDocument(TCollection_ExtendedString("MDTV-CA

5 replies1 file

Reading compressed gltf without bin

I have installed OpenCASCADE with Draco support and can now read compressed GLB and compressed GLTF files with BIN files. However, I am unable to read compressed GLTF files without BIN (embedded GLTF) files using the following code: RWGltf_CafReader reader; reader.Perform(gltfFile, msg); I am encoun

16 replies1 file

Issues when importing Step files

Hi, When I imported step files, cracks are always raised between surfaces as attached picture shows. (But, when I import the same file using other packages, such as FreeCAD, it is OK.) So, what is the reason? And what should I do?

4 replies1 file

GLB file is not getting correctly read using RWGltf_CafReader

I am using the Open CASCADE 7.7.0 version on Linux machine. I am trying to read a GLB file using the RWGltf_CafReader class, add some extra data into the model then again export the new glb model using the RWGltfCafWriter. But looks like reader is not reading the GLB model properly. I am not getting

1 reply1 file

Need To Access Consistent Unique Identifier When Converting Step to GLB

Hello! I have been working on a Step -> GLB converter for our specific use-case. When traversing the labels, is there a unique identifier imported from the Step file that is accessible? Even tree location would be useful if it was guaranteed that each tree location was unique (no duplicates for repe

3 replies

Draco Compression

I am able export gltf with Draco compression. But I don't know about reading Draco compressed gltf file. Does open cascade support import of Draco compressed file ?

3 replies

GD&T values can not be get in .stp file

Hi,team. I`ve tried to get gd&t informations through the code below: STEPCAFControl_Reader cafReader; cafReader.SetNameMode(true); cafReader.SetGDTMode(true); IFSelect_ReturnStatus status = cafReader.ReadFile(srcPath); if (1 != status) return false; Handle(TDocStd_Document) doc = new TDocStd_Documen

2 replies5 files

try to save step file after scaled shape but i loose color

Hi everyone, this is my first post. I try to scale a step object and save to another step file when i transform the shape it works but I lose the color. i try to copy the color of each face from the original to a scaled one but I receive this error: Exception caught: A null Label has no attribute. I

2 replies1 file

how to get the id of entity in STEP file?

hi: while I imported a STEP file by OCC,compare to the text content in STEP file,there are many id of entity just like "#11=","#5="ect,the id show the topology relationship with the other entity. my question is,if can get these id information by Opencascade?is there any way to got it and as same as

8 replies

shape healing on STEP files

Hello, We have a STEP file that has a number of SHELL_BASED_SURFACE_MODELs that each have a single face defined by extruded surfaces. When we import the file, these surface models each produce a TopoDS_Solid that is defined by a single TopoDS_Face face with no edges. Would the shape healing module r

1 reply

Camera animation in GLTF.

Hi, I'm trying to export camera animations in GLTF format. I have created a new node for camera and added all the animation information. However, when I view them in Don McCurdy's viewer, the animations aren't playing correctly. After investigating, I found out that while the interpolation data is f

2 replies2 files

How to parse STP files to obtain a complete hierarchical structure?

I can now obtain Components through STEPCAFControl-Reader, but I cannot obtain SimpleSample included in TopAbs-COMPOUND. The hierarchical structure I want is shown in 1. png. My current code is as follows: void ProcessMesh(const Handle(XCAFDoc_ShapeTool)& ShapeTool, const Handle(XCAFDoc_ColorTool)&

3 replies1 file

STEPControl_Reader read.precision.value

Hello, hope you're doing well. Using OCC 7.8.0 to read a STEP file and performing reader.TransferRoots() is taking so long (around 27 minutes) for rounded profiles. For a tube of 6in diameter and 26ft length that has a linear pattern of 78EA 1in holes, and a circular pattern of 8 instances of the li

1 reply2 files

which output ASCII file format to choose?

Hello Forum, Let's say I have a STEP file containing B-Spline BREP definitions of several solid objects. Which output file formats should I choose to get: (1) Each face of each solid written out separately as a mesh of connected triangles (2) The entire solid written out as one closed, water-tight m

1 reply

UV data is missing for the Tessellated geometry objects

I have written the Step to GLB conversion application. I have a step file with Tessellated data. The file is getting exported as GLB but the UV data is missing in it. UV data is not getting generated for tessellated geometry types. For ManifoldSolid_Brep its working. I have attached the sample file.

1 reply1 file

Get origin (gp_XYZ or gp_Point) from shape

Hello everybody, Currently i have a simple method which creates a boxed shape and adds it to the XCAF Document. The vector parameter sets the location of the shape. This seems to work nicely. Creating the Shape bool CreateModel(Vector^ vector) { // Create Geometry BRepPrimAPI_MakeBox make(2, 2, 2);

2 replies

Import misaligned model - Re-align

Hi OCC community, I'm trying to import an intentionally misaligned STEP model, it is a simple angled profile (5in x 5in x 12ft) that has multiple translations and rotations from the world origin. How can I "reset" its position to align it to the global origin and axes before any subsequent operation

0 replies

How to avoid loss of precision when reading large igs/step models

When I use IGESCAFControl_Reader or IGESControl_Reader to load a larger model and display it through AIS_InteractiveContext (or convert it to glb model), the circle of the original model will become a quadrilateral, the curve will become a straight line, I would like to ask if there is a solution to

3 replies1 file