DiscussionsIssue archiveOther usage issues

Forum archive

Other usage issues

Technical discussions preserved from the public OCCT community forum.

Topics
5,359
Replies
16,480
Files
825

Discussions

Page 3 of 90

Showing 60 discussions, ordered by the latest archived activity.

Undo/Redo Mechanism in a Qt Occ App

Hi Guys, I have developed a CAD application in Qt using opencascade libraries. It does all the basic works like pan, rotation, zoom, scale. I have not used OCAF to build all these. Now I want to implement undo/redo option in my application. Is it necessary to do everything using OCAF or is it possib

4 replies

Get boundary

Hello I am currently working on importing the files of stl, step, and iges and displaying them on 3d. The 3d shape has been displayed, but I don't know what to do with the edge. If you look at the cad assistant program, I want to show the boundary in display mode like wireframe or shaded with edges.

0 replies

STEP Entity ID

Hi, I have started a program that reads a STEP file into OCC, and allows selection, with the AIS libraries. It can select different edges and faces. I can detect the selected faces/edges, and get a ToposDS_Shape object. How to I get the original STEP ID# of the face/edge, and other similar entities?

2 replies

Initialization of NCollection_Array2 in a class

Hi all I am writing a program that creates geometric models, with each geometric element is defined in a class which holds the parameters and also the calling functions. Therefore there are 1D and 2D arrays to be initialised every time a class instance is created. So far I managed to create NCollect

4 replies

BRepAlgoAPI_Fuse will cause shape corruption.

Hello. When I try to fuse shape1 and shape2, the result shape is corrupted. Is there a way around the problem? I have confirmed that shape1 and shape2 are valid shapes in the BRepAlgoAPI_Check class. [Code] BRepAlgoAPI_Fuse fuseShape( shape1, shape2 ); fuseShape.Build(); TopoDS_Shape shape3 = fuseSh

4 replies4 files

TopoDS_Shell is created by the cut operation of TopoDS_Solid and TopoDS_Solid.

Hello. When I try to cut shape1 by shape2, the result shape is corrupted. Result shape include some TopoDS_Shell. Is there something wrong with the input shape? [Code] BRepAlgoAPI_Cut cut( shape1, shape2 ); cut.Build(); if ( cut.IsDone() == Standard_False ) { return; } TopoDS_Shape shape3 = cut.Shap

0 replies4 files

How to use Handle

Geom_BSplineCurve BSC(Poles, knots, mults, Degree); Handle(Geom_BSplineCurve) hCurve(&BSC); BRepBuilderAPI_MakeEdge anEdge(hCurve); const TopoDS_Edge &shape = anEdge.Edge(); I cant understand why this isn't work with error "Invalid address specified to RtlValidateHeap( 00000172A2F50000, 0000002D1691

1 reply

How to show my own GD&T information

Since I have an ap242 step file with GD&T data,I load it in my document and use DimTolTool to get all GDT presentations,then with method "GetGDTPresentations" I will get a map with all GDT TopoDS_Shape,and I can show them in my visualize window.Actually the the GD&T information is define by other so

0 replies2 files

GTK GUI for Cas.Cade Application

Hi, Has anyone used GTK or glade for making GUI for cascade applications? If yes can I get some help about it? I have built the basic window and controls using GTK but don't know how to integrate a cascade viewer and functionality to it. Plesae help. N. Author

15 replies

How to judge smart pointer "Handle" is null pointer

Hi Bros, I get some question when use the smart pointer "Handle" of OCCT. As we know, in C++, judge null pointer can use “if(p==nullptr)”. However, in OCCT it seems not work. I can use "IsNull()" to judge some smart pointer like "Handle(TopoDS_Shape)", cause TopoDS_Shape has function "IsNull()"; but

2 replies

How to get centroid using XDE?

Hi. I try to access the attribute of assembly tree of XDE. I can get names of assembly or component but I can't get centroid. Here is my code. Please help me. STEPCAFControl_Reader reader; IFSelect_ReturnStatus stat = reader.ReadFile("filename"); Handle(TDocStd_Document) aDoc; Handle(XCAFApp_Applica

2 replies

Overload of gp_Vec operator*

Operator* for 2 gp_Vec instances cannot return double value. Thus, the operator has to be overloaded. Can somebody point me where it's implemented? Or is it a dot product of two vectors? Thank you in advance.

0 replies

How to discretize points on edges, make 3D plane and calculate residuals

I am trying to discretize points on edges, make a plane out of them and calculate residuals. For the moment, we use the trial version of OCC java wrappers (latest dev version) until our license gets processed. I did search forum and there are posts with recommendation to use GCPnts_UniformAbscissa.

0 replies

OCCT in the browser

We have a research project where we need to implement certain CAD functionalities in the browser. We plan to build a chrome web app using three.js for 3d visualization. However, we also need to perform various geometric operations (e.g. loft, intersections, booleans, etc), and we therefore need a mo

4 replies

How to get Poly_triangulation from STEP file?

Hi, I want to convert a STEP file into an STL file and then do some analysis using the data of vertices and faces of the STL mesh thus obtained. Poly_triangulation provides that data but the only way I could find to obtain Poly_Triangulation data is by using RWStl::ReadFile(). In this case, I have t

1 reply

Hiding label from tree view of shapes

Can anyone tell me how to hide the label in the hierarchical data template that comes back when shapes are loaded? I can collapse the text block (which shows the label) in the template but when the shapes are displayed, there is some highlighting going on, which I cannot seem to turn off. Thanks.

0 replies

Wrong bounding box dimensions

Hi, I noticed an error when I used it to do some calculations with the bounding box information of a shape. result X Y Z CAD Assistant Min: -95.7296 mm, 29.6258 mm, -26.7835 mm CAS Assistant Max: 0.384177 mm, 120.021 mm, 69.2307 mm My code Min: -95.3497 30.0011 -26.4022 My code Max: 0.00350084 119.6

1 reply1 file

OCC and Delphi

Is there an example for using occ with delphi? There was nothing in the distribution or in this community... greetz

12 replies

FaceBoundaryDraw Not Work as expected

In previous version of opencascade I can draw shapes with visible edges with just that; myContext->DefaultDrawer()->SetFaceBoundaryDraw(true); But after I migrated to 7.4.0 it doesnt work. and I tired already those; myContext->DefaultDrawer()->SetFaceBoundaryDraw(true); myContext->DefaultDrawer()->F

1 reply

Use QT with Opencascade in WebAssembly

Hi. I'm currently trying to use Opencascade within a Qt Application with QML in WebAssembly , and i was wondering if it was possible to achieve this. since i can't use the OpenGl_GraphicDriver->Init() method, giving me this error in the console output of Chrome : exception thrown: TypeError: Cannot

4 replies1 file

Convert with command line

Hey guys, I need to convert some STEP-files in OBJ or OFF files. I just found this great program "CAD Assistant" that is able to do so on this website. Since I need to convert several hundreds it would take much time to convert them manually. Is there an easy way to convert the files with the comman

5 replies

Error while calling STEPControl_Writer

I'm writing a function, that will write a STEP file from a TopoDS_Shape( pic-1 ) And I'm Getting some error while running in Qt Creator(pic-2) , Also i have Included the required header file. please help me get out of the problem.

1 reply3 files

Can I implicitly link against OCC in a closed source Visual Studio application?

Hello, The prebuilt Windows installer comes with a set of static libraries (e.g., TKBin.lib) in addition to the dlls. I think these might be all import libraries which are used for the purposes of implicit linking with the DLLs because Visual Studio's LINK.exe is not capable of linking with PE binar

7 replies

[QUESTION] Understanding how OpenCASCADE works

I am currently reading these books: https://www.amazon.com/Solid-Modelling-CAD-Systems-Survive/dp/0857292587 and: https://www.amazon.com/Boundary-Representation-Modelling-Techniques-Stro... And i'm researching on how CAD software like OpenCASCADE works, i'm in the part of how extrusion algorithm wor

0 replies1 file

How to get the unselected interactive object in a context

Hello, I am using OpenCascade V7.4.0 on 32bit windows. On the AIS_InteractiveContext class, there are routines : InitSelected () MoreSelected () NextSelected () They allow to iterate the selected objects, but I don't know how to get an unselected object. Is there the corresponding function for local

0 replies

A possible bug in intersection of cone and cylinder

I meet a problem when making the intersection of cylinder with a cone, following is the code: // make cone TopoDS_Shape box1 = BRepPrimAPI_MakeCone(100, 0, 400); // make a cylinder with a offset from X axis gp_Ax2 ax2( gp_Pnt(-10, 0, -20), gp_Dir(0, 0, 1) ); TopoDS_Shape box2 = BRepPrimAPI_MakeCylin

4 replies

Correct face normal calculation

Hi, I've noticed that this topic has been coming up a lot, without a conclusive solution, so: Is there a unique way to determine an outwards facing face normal? I've tried GProps, SLProps, using orientation info to invert the normals, you name it. However, some faces still get culled, some don't but

7 replies

Porting from Qt5.15.2 to Qt6.0

Hi Friends, I have a working project using OCCT-7.5.0 and Qt-5.15.2, I am using QQuickFramebufferObject to visualize OCCT inside Qml. There are many changes in graphic stack in Qt6, but in theory, it is still possible to use OpenGL, I have updated the dependencies and i have set GraphicsApi to OpenQ

4 replies

the usage problem of occt7.5

I had compiled the occt7.5 by cmake and vs2017 in window 10. There is no problem when I compile the Occt7.5. However, when I run the program written by occt7.5 and qt in the vs2017, the vs throwed the error. The vs cannot find the locate the program input point, such as these calsses: Quantity_Color

1 reply

How to use DumpJson?

I have found that many classes have a DumpJson function. However, I can't found any example about it. Is it used to store data and command? Or is it used to implement the undo/redo funcitonarity? If so, how to use DumJson?

1 reply

Segfault in OSD_Host::InternetAddress

Hello, When writing a STEP AP203 file, the fallback value for the organization is the computer's IP address. This function segfaults, because gethostbyname returns a null pointer. https://github.com/Open-Cascade-SAS/OCCT/blob/master/src/OSD/OSD_Host.cx... OS: Linux 5.8.16 OCCT Version: 7.4.0p1 Backt

1 reply

Generating and reading BRep files

Hello, I am relatively new to OpenCASCADE and as one of my first steps I want to create a BRep file, save it and then read it again. For this I made the attached cpp file. In my example I create a tetrahedron and save the TopoDS_Shape with BRepTools::Write as a BRep file. But when I try to read it w

2 replies1 file

The problems of visualization by Qt (when the compiler start and exit the program)

I met two problems when I use Qt to visualize the OCC. First, when I run the program, the QWidget can't display OCC view immediately, which bind the view of OCC. Second, when the program is exited from the debug mode, the compiler will throw the TCl_exit error(Exception thrown at 0x00000000100BF7EC

1 reply

Undefined references when compiling

I built OCC as static libraries, and now I want to build a static binary for portability. My code is: // STEP Read Methods #include <STEPControl_Reader.hxx> #include <TopoDS_Shape.hxx> // STL Read & Write Methods #include <StlAPI_Writer.hxx> #include <BRepMesh_IncrementalMesh.hxx> // Bounding Box #i

5 replies

Handle Type Conversion

Hi guys, I have an issue. The codes are: Handle(IGESData_IGESEntity) igesEntity = Handle(IGESData_IGESEntity)::DownCast(aList->Value(j)); if (aReader.TransferEntity(igesEntity)) TransferEntity take "const Handle(Standard_Transient)" as input argument. But the compiler complains: no suitable user-def

1 reply

Face made from surface is changing her boundaries

Hello, Context: I have solid and all of its faces have CN continuity except two faces which have C0. I need to make those C0 faces become at least C1. So, i tried to approximate surfaces of C0 faces with GeomConvert_ApproxSurface() and then make new faces of them. However, this method works not in a

0 replies2 files

Slow rotation and panning with many points

Hello, when I draw an high number of points (more than 1000) my view gets very very slow when I rotate or pan. I draw the points one by one using this code: gp_Pnt pnt(f_p[0], f_p[1], f_p[2]); TopoDS_Vertex V1 = BRepBuilderAPI_MakeVertex(pnt); // Create the AIS_Shape Handle(AIS_Shape) point_shape =

3 replies

RWGltf_CafWriter is missing

I can't include the RWGltf_CafWriter header file . I searched the files and can't find them out .

2 replies

IGES file to STL file conversion issue

My aim is to convert a IGES file to STL file and I tried running the below code and I got the following output in CMD. But the conversion did not happen and the STL file was not created. How should I use this StlAPI_Writer? I also tried BRepMesh_IncrementalMesh and tried using the RWStl.hxx to write

1 reply

gltfwriter not writing json

I am trying to convert STP to glTF and it is writing bin file but not writing json file. Here is my code const TCollection_AsciiString aFilename = toAsciiString(theFileName); const TCollection_AsciiString oFilename = toAsciiString("collar-assembly_asm"); Handle(TopTools_HSequenceOfShape) aHSequenceO

1 reply

Using StepControl Reader

Here is my Code Snippet : #include <StepControl_Reader.hxx> #include <XSControl.hxx> int main() { STEPControl_Reader reader; return 0;} But I get : Error LNK2001 unresolved external symbol "public: virtual int __cdecl XSControl_Reader::NbRootsForTransfer(void)" (?NbRootsForTransfer@XSControl_Reader@

3 replies

BRepOffsetAPI_MakeOffset in wire and face odd in occt 7.4.0

Hello everyone, I do not know if you have encountered this problem. When I use BRepOffsetAPI_MakeOffset of occt 7.4.0, I hope to achieve the effect of Figure 1: Select a closed wire frame (the wire) of a face on the model, call the BRepOffsetAPI_MakeOffset interface, and generate an offset line of i

0 replies1 file

BRepOffsetAPI_MakePipeShell bspline error

Hello everyone, I do not know if you have encountered this situation? BRepOffsetAPI_MakePipeShell from a spine of bsplinecurve and a profile of circle, but strange results appeared. See Figure 1 and Figure 2 specifically. I don't know how to eliminate this problem. In addition, but if the spine is a

0 replies3 files

BRepOffsetAPI_MakeOffsetShape help

I am trying to integrate the use of BRepOffsetAPI_MakeOffsetShape , but it fails most of the times even in simple shapes. The attached example is a box sliced with a plane (not parallel to the coordinate planes) and I want to offset with 1mm. I tried all the combinations, but with no luck. What is w

2 replies1 file

Wrong Normals after IGES import

I am trying to import the IGES file and then want to iterate through each face to get correct face normal. But I am getting wrong normals for the face.Here is the steps which I am following. 1.Read IGES using IGESControl_Reader 2.Sew the body using BRepBuilderAPI_Sewing 3.Try to repair the shape usi

9 replies4 files

Reject Clipped Objects from selection

Hello, I'm using OpenCascade within a .Net wrapper and I noticed that AIS_InteractiveContext MoveTo is detecting objects when the point is actually over a part of the object that is clipped by a ClipPlane. I can handle this locally by checking the world point against the Clip plane's half-space, but

8 replies5 files

How to select an edge or a face of a solid

Hello everyone, I want to select an edge or a face of a solid. My code is below: void setFilter() { Handle(StdSelect_ShapeTypeFilter) solidFilter = new StdSelect_ShapeTypeFilter(TopAbs_SOLID); Handle(StdSelect_FaceFilter) faceFilter = new StdSelect_FaceFilter(StdSelect_AnyFace); Handle(StdSelect_Edg

3 replies

Getting wrong X,Y,Z coordinates

I can get (x, y, z) via gp_Pnt ConvertClickToCoordinate(int x, int y, Handle(V3D_View) aView) when using Projection_Orthographic projection type. But the result is wrong when using Projection_Perspective projection type. Anyone there has any idea to fix it?

2 replies

Set camera inside box

Hi, I have an issue that I have been trying to get to work without success. I want to put a camera inside a box so I can see the inside of it, let's say the box is 1000x1000x1000 and I want to place the camera at 500x500x500, how can I do that? I use the class Graphic3d_Camera: from OCC.Display.Simp

2 replies

STEPCAFControl_Writer.hxx unknown type name 'NCollection_Vector'

Hello, I'm having difficulties in compiling my program. My compiler output: In file included from ../src/STEPModel.cpp:19: /opt/local/include/opencascade/STEPCAFControl_Writer.hxx:236:3: error: unknown type name 'NCollection_Vector' NCollection_Vector<Handle(StepRepr_RepresentationItem)> myGDTAnnota

3 replies

Make a cylindrical face : why oh why ?

Hi folks, I'm totally struggling with an apparently very simple task : create a cylindrical topological face. For testing purposes, I'm trying to build a cylindrical face from a cylinder centered on (0, 0, 0) and directed to +Z, and 4 edges delimiting the face to the 0..Pi/2 quadrant from Z = 0 to Z

1 reply

Inconsistent error output from DRAWEXE

My test script: $ cat test pload MODELING VISUALIZATION vertex A 0 0 0 vertex B 0 0 25 vertex C 0 0 0 vertex D 0 0 5 edge e1 A B edge e2 C D wire w1 e1 e2 revol s1 w1 -5 5 0 0 0 1 360 vdisplay s1 vfit When I run it from interactive session with "source test" it works fine. When I fur it from command

1 reply

List all triangulated vertices without duplicates

I wonder if its possible to retreive a list of all triangulated vertices without duplicates for shapes. I'm using "BRepMesh_IncrementalMesh" to mesh my shapes and can access and get the vertices per face using "BRep_Tool::Triangulation(aFace, aLoc)". Hhowever, if I want a list of all vertices (witho

1 reply

Why crash BRepAlgoAPI_Cut

Hello. I use OpenCascade V7.4.0 for windows 32bit. I am trying to get the cut part of two shapes according to the code but it crashes app. TopoDS_Shape base; BRep_Builder bb1; BRepTools::Read( base, "C:/@test/base.brep", bb1 ); TopoDS_Shape cutter; BRep_Builder bb2; BRepTools::Read( cutter, "C:/@tes

0 replies2 files

wrong normal directions by use BRepLProp_SLProps

This is part of my code, and I got some wrong normal directions by use BRepLProp_SLProps, Can you give me some advice?thanks a lot for (faceExplorer.Init(aShape, TopAbs_FACE); faceExplorer.More(); faceExplorer.Next()) { TopLoc_Location loc ; TopoDS_Face aFace = TopoDS::Face(faceExplorer.Current());

1 reply

AIS_Dimension & Relation

Hi, Can someone please help me to understand exactly how the AIS_Dimension and Relation is used to display the dimensions of objects. I have tried by the documentation but am unsuccessful yet in displaying dimensions. Some example code will be more helpful. Please help. N. Sharjith

1 reply

hidden subshapes made unselectable in viewer

Hello forum, A subshape of a shape can be made hidden. Is it possible to make that subshape unselectable (transparent to the highlight and selection mechanism)? Thanks in advance Author

2 replies