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

Showing 60 discussions, ordered by the latest archived activity.

Issue reading colors compared with CAD assistant.

Hello, Does Current version v7.8.0 (or previous one like v7.7.0 ) use the same methods to get label colors as it does the CAD Assistant tool ? In our case we are facing the same issue since v7.7.0, where on IGES files we are unable to get colors from labels. Things that we know: - CAD Assitant reads

19 replies15 files

Texture not correctly applied on shape when exporting to glTF

I suspect it's an issue with the UVs in the shape. With the code below, I see that the UV coordinates are very large (shouldn't they be between 0-1?), TopExp_Explorer exp(s, TopAbs_FACE); while (exp.More()) { TopoDS_Face face = TopoDS::Face(exp.Current()); TopLoc_Location loc; auto triangulation = B

5 replies4 files

Color Discrepancy Between Tessellated and Non-tessellated STEP Files

I'm importing STEP files using OCCT 7.8 and there is a discrepancy in the model’s coloration depending on the representation. Basically, when the STEP file has an exact representation of the geometry (via ABSH for example), the colors are correctly retrieved. However, STEP files with tessellated rep

3 replies2 files

Issue reading colors and names compared with CAD assistant.

Hello, Does Current version v7.8.0 (or previous one like v7.7.0 ) use the same methods to get label colors as it does the CAD Assistant tool ? In our case we are facing the same issue since v7.7.0, where on IGES files we are unable to get colors from labels. Things that we know: - CAD Assitant reads

1 reply1 file

Extracting Surface Type Information From Step File Import

Hello Again, I am attempting to extract surface/face related information coming from Step files. For example, a surface/face might be identified as: - plane - conical - cylindrical - spherical - fillet Is there a way to extract this information from a STEP import? Example of surface data in step fil

1 reply1 file

STEPControl_Writer false

Hello, i export an assembly(which is TopoDS_Compound, it contaning one solid and one compound) to step file.But there were something went wrong.The problem is that when i use writer.Transfer(assembly, STEPControl_AsIs), this process change the index of solid and compound as shown in picture. The lef

3 replies3 files

Extracting Dimension Data From Step File

Hello Dmitrii! Hope you are well. I have recently started to extract dimension data from steps files. I am able to get the data but not everything I need. Mainly I am trying to just get the primary data about the dimension i.e. - Attach Point(s) - Value I noticed that depending on the export type ST

6 replies3 files

Changed dependencies of STEP and IGES classes

Not only they have re-organized, but it now seems that they fully hard-depend on the application framework. It means that deployment fully requries CAF DLLs (XCAF LCAF V3D TKService etc), while before the data exchange framework could work without the application framework....

3 replies

Save AIS_Dimension derived objects to a file

Hi guys! I'm new to OCCT and need some help. I import a complex model from a IGES or STEP file. This works so far. The goal is: the user makes some lenght dimensions on the model and than save the hole thing to a file. <!--break--> I know there is the XDE Tool and I'm able to save simple Objects (bo

2 replies1 file

Updating to 7.8.0 from 7.7.0 Logs All STEPCAFControl_Reader::Transfer Data

Hello! After updating to 7.8.0, when reading a step file and transferring it to the XDoc, everything is logged. I should also note the the translation takes much longer. 2 Questions: Is there a way to disable all of this logging? Is there a reason the translation would take longer now? Thanks you! -

3 replies2 files

Using plane to slice solid and extract single face

Hello, I am kind of new to opencascade and coding in general, so bare with me. I need to slice a long beam and extract a face to use for further calculations (Area, second moment of area, etc.) But when I try slicing the beam with a plane, I only get a wire without any information where the cut goes

0 replies2 files

Degenerate_toroidal_surface in step files can get wrong orientation

Hi all, I have a problem with dealing with DEGENERATE_TOROIDAL_SURFACE field in step files. My process is I create a geometry in a CAD-tool (we use onshape), which I then export to a step-file, in order to interpret the geometry in a set of downstream tools. In cases, if the geometry includes a gene

0 replies5 files

IGESCAFControl_Reader property for invisible meshes

I have an IGES file that has some set Views in it (TopView, BottomView, RearView, FrontView and SideView). Views are supposed to be invisible and only meant to align the camera. However, when OCC translates imports, the views are treated as normal surfaces, becoming visible. I tried looking into som

0 replies3 files

Properly linking the color of a subShape with the shape when exporting

I'm working on a small application that translates STEP files to other file types. I'm having issues on getting the color to show properly on the object. From what i've read in Extended Data Exchange (XDE) - Open CASCADE Technology Documentation , the color can be stored either in the shape, in its

3 replies1 file

STEP write AXIS2_PLACEMENT_3D

Hi! Using GeomToStep_MakeAxis2Placement3d mapping (Geom_Axis2Placement, gp_Ax2, gp_Ax3, StepGeom_Axis2Placement3d) it is possible to give a name to a coordinate system. What is the proper way to write this coordinate system entity as a named AXIS2_PLACEMENT_3D to a STEP file in OCAF framework? Could

1 reply

remove a specific component from the assembly instance

I would appreciate guidance on how to modify the XCAF document if I intend to remove a specific component from the assembly instance on the left(pic in Attachments), considering that both assembly instances refer to the same assembly.

1 reply1 file

How to delete free wire in .step

I find some free edges and wires when i load some .step file,I want to delete that to make a normal .step file

0 replies2 files

Read the MANIFOLD_SOLID_BREP entity as a single and separate shape

Hi I am reading a step file using the STEPCAFControl_Reader and writing the glb file using the RWGltf_CafWriter. The step file contains the part objects with multiple solid bodies. You can see below in the Step entities. #26216 =PRODUCT_DEFINITION('C101046-01','C101046-01',#26240,#26195); #26127 =PR

2 replies

Logical ideas for displaying model assembly information

Hi, everyone! I have two questions. The first one is about assembly display. I can read the assembly of the model through XDE, but I encountered a situation where when the assembly of the model only has 1, it will display the Solid or Compound of the model.ex: Archived image: external image (CAD ass

5 replies4 files

How to remove duplicates from Shape?

I'm reading an iges which will have two identical faces and edges. But they will have different HashCode. After I changed them GCPnts_TangentialDeflection and Poly_Triangulation they have exactly the same gp_Pnt and Node I tried Shape.is_partner , Shape.is_same , Shape.is_equal but they couldn't be

2 replies3 files

Is the sourcecode actually processing CAD layers?

Hi, I'm using OCCT 7.7.2 and I'm trying to use LayerTool::GetLayer(). As you can see in the source code, right now seems to return the name attribute instead of the actual layer. Please see attached screenshot to see source code from 7.7.2 and screenshot from inspector in order to verify that sample

9 replies4 files

Import .OBJ File?

I tried the following but failed. Could you please give me an example of how to import an .OBJ file? please. Handle(TDocStd_Application) anXdeApp = new TDocStd_Application(); BinXCAFDrivers::DefineFormat(anXdeApp); // to load XBF files Handle(TDocStd_Document) anXdeDoc; anXdeApp->NewDocument("XDE",

2 replies

can't read .brep(the result is false)

I use these code to read .brep, but it can work. TopoDS_Shape shape_Brep; BRep_Builder builder_Brep; std::string filename = "./data/Cir_Rect_int.brep"; bool result = BRepTools::Read(shape_Brep, filename.c_str(), builder_Brep); VS shows that result is false, and shape_Brep is null.

1 reply

JTteader and JT assistant license change?

Apologies in advance if this is not the right place for this question... Could the license for the old JT assistant and JT reader code on the git site be updated to match the license for OCCT? This would enable features derived from that to be distributed with, for example, FreeCAD and would just am

2 replies

Can't open .step file

hi guys.I can't open some .step when i using opencascade.but It can be open by solidworks normally,I don't know what's wrong with this file or my code,here is my code: STEPControl_Reader aReader; auto sss = string_To_UTF8(aFileName); IFSelect_ReturnStatus status = aReader.ReadFile(sss.c_str()); if (

1 reply2 files

segmentation fault on loading model

When loading a step file I get a segmentation fault. I've got the following debugging information. I'm afraid I cannot share the step file due to the sensitive nature of the design, but I'd love to assist on investigating this issue further. Any pointers would be appreciated since my knowledge of th

5 replies

Obtaining the "other" name entity from PRODUCT in Step file.

Good afternoon, I have a large step file with the following lines: #549838=PRODUCT('name1','name2','Description',(#549727)); #549421=PRODUCT_DEFINITION('name1','name2',#549559,#549310); #549697=PRODUCT_RELATED_PRODUCT_CATEGORY('name2','name2',(#549838)); #2343=NEXT_ASSEMBLY_USAGE_OCCURRENCE('name2:1

1 reply

Read GENERAL_PROPERTY with StepBasic_GeneralProperty

Hi. How can I read the GENERAL_PROPERTY of each nodes? Should I use one of this tools? m_stepData = new STEP_Data(cafReader.Reader()); m_shapeTool = XCAFDoc_DocumentTool::ShapeTool(doc->Main()); m_colorTool = XCAFDoc_DocumentTool::ColorTool(doc->Main()); m_gdtTool = XCAFDoc_DocumentTool::DimTolTool(

12 replies

How to read STEP color properly as CAD Assistant

Dear OCCT community, when I use CAD assistant to read a STEP file and I open material manager I see this: Archived image: external image When I read color by using XCAFDoc_ColorTool as colorReader->GetColor(label, XCAFDoc_ColorSurf, color) I will get color circled as blue #101603FF, which is too dar

7 replies8 files

Can't read IGES file with cyrillic simbols in name ot path.

Hi, I try to read IGES file with cyrillic simbols in name or path. Project was build under windows with multy-bytes coding. Whay I am doing wrong? bool IgesIO::ReadShape (CString FileName ) { try{ ; if (m_Reader.ReadFile(FileName) != IFSelect_RetDone) return false;

3 replies

JTAssistant sources TKJT

in OCC 7.7.0 can't use JtAssistant sources to import TKJT. It uses MMgt_TShared but how can I add it to the project?

0 replies

OCCT 7.7.2 seems to come with IGES import issues:

I tested with v7.7.0 and we are able to correctly import the sample file (please find sample file attached). We expect the sample file to come with colors, but with 7.7.2 , there are none. I think that the issue is related on how OCCT reads sub labels. The same file but in STEP format (converted usi

0 replies2 files

Convert from CAD file input to desired output units

Similar issue regarding this topic : Although the previous link seems to be solved for the author, I'm unable to make it work: I have a STEP file (see attached file) where the main units are millimeters, I want to convert that to other values e.g. meters. I'm setting the static variable before creat

4 replies2 files

STEP unit conversion and meshing

Hello, For 99% of my STEP files, I use the conversion from the static interface: Interface_Static::SetCVal("xstep.cascade.unit", "M") And the BRepMesh_IncrementalMesh and it works as expected. For some reason, I have a STEP file composed of an assembly of shells, and meshing fails as all triangulati

9 replies

Simultaneously extracting GD&T data and correct Location data from STEP AP242 file

Dear fellow OCC users, I am trying to simultaneously extract GD&T data and the location of this GD&T data from a STEP AP242 file, to reproduce the following scientific paper: https://doi.org/10.1080/0951192X.2022.2145017 . Essentially I need to extract not just the GD&T data, but also the location d

0 replies

Any way to get the CAD axis system reference?

I'm working on a CAD importer. Everything seems to go as planned, bu we recently detected an issue regarding the rotation of the resultant CAD file. After a few tests it seems to be something related on how OCCT reads the data related to the system axis. I will show a sample cube, imported with CAD

6 replies5 files

Stuck while reading IGES

Hi, I am testing the efficiency of OCC reading files. I found that this file is very slow to read. I gave up after waiting for 10 minutes. But this file can be opened in Rhino and is very fast, taking only a few seconds. After exporting from Rhino, it can be read normally using OCC. Is this a bug? I

9 replies1 file

TPrsStd_AISPresentation Can't Select Shape

I use STEPCAFControl_Reader read STEP file , i can import STEP file and display, however i can't detect or select shape. This is my code: Handle(XCAFApp_Application) anApp=XCAFApp_Application::GetApplication(); Handle(TDocStd_Document) aDoc; anApp->NewDocument("MDTV-XCAF",aDoc); TCollection_AsciiStr

2 replies

IGES test files

Hello, I am looking for some kind of sample files to test OCCT IGES import functionalities. I have difficulties generating some particular IGES types that I would like test, such as types 114, 118, 120 and 122. Where can I find sample files?

0 replies

Name attribute not find with FindAttribute

Hello everyone, Using the inspector tool that comes with OCCT we can see that my test STEP file contains that label with an attribute name (see attachment 1). If I use the next code, I'm unable to get "Grip of Hammer" as the attribute name: if (label.FindAttribute(TDataStd_Name::GetID(), nameAttr))

0 replies1 file

Memory Leak when using STEPCAFControl_Reader

Hello, I am encountering memory leak in the following function as pointed out by valgrind: Handle(TDocStd_Document) ReadStep(std::string filename){ STEPCAFControl_Reader Reader; // Create XDE document. Handle(XCAFApp_Application) app = XCAFApp_Application::GetApplication(); BinXCAFDrivers::DefineFor

10 replies2 files

XCAF - Getting GD&T in a visible form

Hi Team, I have been trying to get a visible representation of the GD&T data contained within a STEP(AP242) file by using XCAF I am using the sample file 'nist_ctc_02_asme1_ap242-e2.stp' - attached in a .7z but also available from https://www.nist.gov/ctl/smart-connected-systems-division/smart-conne

16 replies3 files

Density in STEP File

Hi: I'm confused by this code in STEPCAFControl_Writer.cxx which assigns a density to a solid: // write MRI if( aDensity > 0 ) { // mass Handle(StepBasic_SiUnitAndMassUnit) SMU = new StepBasic_SiUnitAndMassUnit; SMU->SetName(StepBasic_sunGram); Handle(StepBasic_DerivedUnitElement) DUE1 = new StepBas

0 replies

The error correction of save file

Hello All, I make a Topods_Wire has small ring and use it build Topods_Face. When I save this model as STEP file, I found save file can correct the error of model. The functions delete the small ring and use a new fit point replace that small ring. If save as IGES file,it has different error correct

0 replies1 file

read and visualize a landXML file

Hello, is it possible to use OCCT (or OCAF) in order to read and visualize a landXML file. This file could for instance describe road alignments for bridge design, ie 3D curves? Thanks /UA

0 replies

STEP/STL model traversal vertices question

Firstly, the rectangular model is used as the standard to explain, and the number of vertices is 8. Next, I read the model and use the code to traverse the number of vertices of the model: for (aVertexExp.Init(shape, TopAbs_VERTEX, TopAbs_SHAPE); aVertexExp.More(); aVertexExp.Next()) { vertexCount++

5 replies

Get "MANIFOLD_SOLID_BREP" entity names with STEPCAFControl_reader

I'm currently using "STEPCAFControl_reader" with the translation parameter "read.stepcaf.subshapes.name" set to 1 (otherwise XDE doesn't expand to sub-shapes). I can find the names of the "MANIFOLD_SOLID_BREP" entities with ShapeTool "FindSubShape", but it returns 0 whenever there is only one sub-sh

2 replies

Replacing a topods_shape with an updated version.

Hello, I have some code where i try to change the thickness of shape inside of a step file. I read the file into a TDocStd_Document, and i have the corresponding shapetool. My function takes the shape of the main label of the document, and extrudes this by a certain scaling factor. I'm having issues

0 replies

Cannot get subshapes from shape_tool

Hi, while trying to read an IGES (in the attachment) file using OCAF I get a Compound from the first label. When I try to get the subshapes it fails. I am using Clion and can see that there are at least 13 subshapes in shape_tool->mySubShapes->mySize=13, but for some reason the shape_tool function G

1 reply1 file

Large step files

Hello everyone, I use OCCT(v7.6) for my C# project and would like to import large step files to my application. For example there is 440 MB step file and when I import that looks like it will last forever. After 20-25 minutes, the memory usage becomes too much and the computer closes some programs b

7 replies

Step writting and set color

Hi, I have got an issue with STEP writer, I have updated my Opencascade version and color are not exported. On version 6.7.1 everything works well but with version 6.8.0 and 6.9.3 the color writing don't work. I search on release note for a regression or a bug but i don't find anything... Am I missi

4 replies

Fail to Convert Geom_RectangularTrimmedSurface in Step Files to Gltf Files

Hi guys! I am trying to convert step files to gltf files. However, one Geom_RectangularTrimmedSurface which is a cylindrical surface in a step file is converted to a spherical surface in the gltf file. Quite confusing! Here is my code (from official sites): int main(int argc, char* argv[]) { const c

4 replies5 files

custom properties from STEP to GLTF

Hi guys! I use STEPCAFControl_Reader for reading step-files and STEPCAFControl_Reader for writing gltf. Is it possible to get custom properties (like "density" from the attached file) from the intermidiate TDocStd_Document or in any other way? I need to write it into extra fields of the resulting gl

4 replies4 files

Step file units

Hello All, How to get units for mass and length while importing STEP file? I am using STEPCAFControl_Reader class. Thanks & Regards, Author

1 reply