I want to perform a Boolean operation between a TopoDS_Face of a sphere and a TopoDS_Shape of a cube located at the top of the sphere. I use BRepAlgoAPI_Common to perform a Boolean intersection operation between the face and the shape, obtaining the portion of the face that is clipped. The sphere co
Hello, I am trying to run HLR algorithm on the shapes obtained from an imported GLTF model. But I always get empty shapes when I extract using HLRBRep_PolyHLRToShape class. This happens when using HLRBRep_PolyAlgo as well as HLRBRep_Algo. I do get expected results for STEP and IGES models though. Ca
Hello, I want to implement a small code that takes a shell as input and does the following: extract the outer edge of the shell as a wire, project the wire on Z=0 plane, then offset the projected wire by X mm (small compared to shell dimension, but might be not so small compared to shortest radius o
I hope to use some constructed faces to divide the solid into multiple parts. How should I do this? Which interface should I use? Currently, I am using the BOPAlgo_Splitter interface to implement this. In the example below, the result doesn't seem to be normal, and there are many warnings. Could you
Hi everyone, I'm encountering a severe performance issue in our assembly graph generation code that uses OpenCASCADE. The function are_connected(shape1, shape2) is responsible for determining if two shapes are "connected" by computing the distance using BRepExtrema_DistShapeShape(shape1, shape2). Ho
Hi all, As boolean operations, including BRepAlgoAPI_Common are quite error prone, i was wondering if there is an alternative function to find out if 2 shapes intersect (all i need is True/False result, not the exact intersection). Thanks in advance for any tips! Best regards, Author
As you can see on screenshot and step file in zip archive, Wood Top is a sub-assembly with only solid/geometry based children. If I try to get its type name with TopoDS_Shape::ShapeType() , it says COMPOUND But using these two return false. bool bHasChild = TDF_Label::HasChild(); TDF_LabelSequence C
As I mention on my previous question, I am working on OCCT wrapper for UE5. I made STEP and IGES to GLB converter and right now working on an actual CAD importer. My code is this. https://gist.github.com/ffreality/bbf8bae595705c809716e5d2e36dae18 I could successfully parsed a CAD file but in order t
There is an issue with transforming Geom_Line. In theory, having a curve C, transform T, and transformed curve CT (CT = C->Transfored(T)), the following should be true: T(C(U)) == CT(U) However, in OCCT, this is not true for some curves (Geom_Line, for example) if T has a scaling component. Is there
hi, I would be happy to advise you on how to deal with this problem, This is the first time I have this, I don't know how to do it to completely eliminate the difficulty? I read the model from the step file that I have attached. My step file download: STEP FILE Next select FACE and save it on the li
Hello, I am using the data exchange library to read a STEP file and convert the surface data to trimmed NURBS surfaces. I'm looking for the most accurate and robust method to accomplish this. For some STEP files, my present implementation suffers from a number of issues ranging from failed curve ext
I'm using the boolean cut operation to find what changed between 2 models. This mostly works, but there are a few cases where the results are incorrect. To be more specific, it shows that all the model has changed when I know that's not the case. See attached image. This is basically how I'm doing t
Hello, I am generating meshes for some bspline extrusions in OpenCASCADE 7.7.2. The resulting triangulation includes additional nodes added internal to the faces that do not obey the linear/angular deflection as I expect. The attached screenshots demonstrate the issue clearly. In 'expected.png', you
Is it possible to merge cylindrical faces of two bodies that are joined together. Currently it forms a seam which is undesired. I tried BRepAlgoAPI_Fuse to join two bodies and ShapeUpgrade_UnifySameDomain to merge faces. Bodies are joined but faces are not merged. Attaching the result I am getting.
I tried to use the BRepAlgoAPI_Fuse operation to intersect two entities in OCCT, but when I tested it, I found that the interaction between the two entities would go wrong when they were in different positions? I still haven't found a way to solve it. The easy code is at the end of the document, and
I have two parallel edges, both of type gp_Lin. When I call line1.Distance(line2), the result is not ideal. I found that in the gp_Lin::Distance(gp_Lin) function, there is a check to determine if the two lines are parallel. If they are parallel, it calls gp_Lin::Distance(gp_Pnt). Now, I have realize
Hi, everyone, What is the best approach to determine if a plane completely covers another plane? I've tried an approach taking into account first plane axis and checking if that axis intersects the surface of the second plane, but this solution doesn't seem to work for vectors that are non-unit. Bot
Hello, I want to create a line that have consistent profile along it direction. Just like window or picture frame. Here is the code : The first picture is faulty line, and the second is more or less the desired result. I don't know how to set orientation of the fillet profile so it is proper. I woul
In this operation the argument and the tool both have a common edge (Attachment: Highlighted in blue) which affects the boolean cut operation. When we rotate or offset the shape to avoid the common edge boolean cut operation works as intended. Is there a solution to get the boolean cut done without
Hello I cut a solid by a plane and I calculate the geometric properties of the solid below the plane (Volume and center of gravity). I use for this the classes BOPAlgo_Splitter with the property SetRunParallel and GProp_GProps. I repeat this calculation several times to display a graph. It is very s
I have written some code to write open cascade ```TopoDS_Shape``` to a quadrilateral and triangle mesh in the fbx file format however i am experiencing some difficulty, I wish to reduce the complexity of the CAD model as to remove overly complex details like ridges, I was wondering how I can do this
Whilst processing selection from mouse-clicks, I've notice that if I click the same object twice (in my case a Point): aka I select something which is already selected, SelectPoint() throws a SIGABORT and dies. Alas, I don't have the debug OCCT build running. Before I dive into this further, has any
How to check why triangulation.IsNull() when BRepMesh_IncrementalMesh mesher(localFace, deflection, Standard_True); is success? What is wrong? TopLoc_Location location; Handle(Poly_Triangulation) triangulation = BRep_Tool::Triangulation(localFace, location); if (triangulation.IsNull()) { std::cerr <
Hello all, running on version 7.7.0 if I "fuse" two or multiple TopoDS_Shape (made with BRepPrimAPI_MakePrism, BRepPrimAPI_MakeCylinder, BRepPrimAPI_MakeBox etc) with BRepAlgoAPI_Fuse all works as expect. See picture 1.png if I "fuse" a BRepPrimAPI_MakeCylinder with a "self made" cube (picture 2.png
Hello everyone. I would like to ask, the model in the attachment is offset through BRepOffsetAPI_MakeOffset, but the offset fails. What is the reason? How can the modification be successful? I am using OCCT 7.8.0.The following is the code used. // shape is the edge in the attachment BRepBuilderAPI_F
How to accelerate the triangular mesh speed of OCCT is mainly used for visualization. like mesh LOD? I have browsed the document. Now, in my test environment, I have encountered a slow grid generation. I saw this sentence in the document. [wiki-mesh]( https://github.com/Open-Cascade-SAS/OCCT/wiki/me
I have following code for reading shape from file and then using the functionality of ShapeAnalysis_FreeBounds::ConnectEdgesToWires to get a single wire from the edges. In my application, I am not reading these edges from file but they are part of a step file which are 'CUTTING EDGE LINE' edges. I h
Hi all, We are trying to upgrade to a newer version (7.8.0) and it seems most of 'BRepAlgoAPI_Section' APIs are marked as obsolete now. We have intersections to be performed between two surfaces/faces based on a user input. E.g., BRepAlgoAPI_Section* pSectionAlgo; if (_onSurface) { pSectionAlgo = ne
Hi guys, first post here, sorry if wrong section. I came here looking for understanding the proper way of reading the result of a Common operation. I tried to setup a fairly simple experiment and still failed to grasp what is happening wrong : I create two rectangles from BSpline of degree 1 ( So po
I have aligned the section plane along the axis and am attempting to split the model in half. Refer attachment. (Image 1) I was able to achieve this using the [color=blue]BRepAlgoAPI_Section[/color] class. After performing the sectioning, I retrieve the TopoDS_Shape` from the result, which represent
There are three main reasons why my model made an error in meshing: 1. The chamfer of the model is not good, as shown in Figure 1. 2. There are some small grooves in the model, as shown in Figure 2. 3. There is a small gap between the models, as shown in Figure 3. (It should be declared that the two
Hello, I'm converting a quadrilateral mesh model to Poly_Triangulation and saving it to STL, to get the same effect as the graph, when the inner and outer boundaries are very jagged, how do I convert the inner and outer edges into smooth spline curves
Hi I have the same problem to solve as the example given in the documentation (A shell and finding its compartments). I would like to know where to find the example in C++
Hello everyone, I am trying to use BRepAlgoAPI_Cut Algo to cut a cone (Topods_SOLID) with a cuboid (Topods_SOLID). output shape of this function returns incorrect geometry (refer attached image for reference). But in some cases method returns correct shape (refer attached image) do I need to make an
Hello, I am trying to read a small step file containing a very simple shape with a bspline curve (full closed ellipse). After I have read the file, I use this code to obtain the poles: Standard_Real firstParam, lastParam; Handle(Geom_Curve) curve = BRep_Tool::Curve(edge, firstParam, lastParam); Hand
Hello, I am trying to unify a TopoDS_Shape consisting of a few neighbouring faces. I read that ShapeUpgrade_UnifySameDomain can be used for this. However, it does not do anything on my step file. This is the code that I am using: ShapeUpgrade_UnifySameDomain unifyDomains(myShape); unifyDomains.Build
Good afternoon, I have a quick question. Is it possible to convert a "Handle(Geom2d_BSplineCurve) bSpline" to a TopoDS_Edge? I tried the following: gp_Pln plane(gp::XOY()); Handle(Geom_Surface) flatSurface = new Geom_Plane(plane); TopoDS_Edge newEdge = BRepBuilderAPI_MakeEdge(bSpline, flatSurface);
Hi, I'm been trying out the sweep command in Draw and have found that when the profile of the sweep is reducing I don't get an accurate shape. Here I have copied the profile in Z direction and scaled to make the end profile smaller. If I make the start and end profiles the same size then this error/
I have imported GLB file For the section view, I am using Graphic3d_ClipPlane class. When I am calculating the section using BRepAlgoAPI_Section by passing it TopoDS_Shape and gp_Pln BRepAlgoAPI_Section section(shapeToSplit, plane->ToPlane(), false); section.ComputePCurveOn1(Standard_True); section.
Hi I have an application where I receive data in an independent format and recreate the shape(s) via OpenCascade. However when using brepgprop.VolumeProperties it gives problematic answers. E.g. the attached file is intended to be a 10,000 x 10,000 x 10 square prism (and visually appears as such), b
Hello, Could you please explain what is the difference between these methods: std::hash, opencascade::hash and MurmurHash ? In OCCT Upgrade guide you wrote that now you use STL hasher. However, in TopoDS_Shape, for example, you use these three different methods. So the question is which one is bette
Hi guys! I trying to run in parallel few series of OCCT functions like intersects/extrusions and so on, for example...for 10 models, but speed in this case is too slow... Why? Ok, if I process 10 models in single thread, i have ~100 seconds of processing time, but if a try 10 threads (i model per on
Hello OCC users, I am using BRepExtrema_ShapeProximity to check all intersecting faces between 2 TopoDS_Solid entities. However, I realized that not all faces within the proximity tolerance are left out. I have confirmed that some left-out faces are within the tolerance by calculating the distance u
I have a couple questions about the BRepOffsetAPI_MakePipe class. #1: The documentation for the constructor of BRepOffsetAPI_MakePipe claims that "The angle made by the spine with the profile is maintained along the length of the pipe". How is the angle between the spine and profile defined? At firs
Hi, All Got on my hands STEP file, which I was able to read and retrieve TopoDS_Shape(TopoDS_Solid). It looks like small tube bent along complex path. I'm able to display it, check flags etc, so far so good. But how I could extract actual solid parameters (radii, bending path)? Any help would be gre
Is there a mechanism using any of the supported Boolean operations (i.e. Fuse perhaps?) which would perform only the imprint? If I have a small cube aligned on one face to a larger cube, I'd like to essentially produce what would be an inner loop on the aligned face of the larger cube without actual
Hello, I'm trying to create a surface (a sphere, a cone, a cylinder, ...) bounded by a wire. What I have is a geometrie of the edges in 3D I have tried many things but could not manage to make it work Probably because my curves are not pcurves but 3D curves I could not find any sample of code to cre
Hello everyone, I am trying to make a fillet on the highlighted edge in the image. I attach the BREP file. I try with fillet of 1 mm. Any ideas what is wrong on my site? Is it just a limitation of the fillet that this case cannot be handled? I tried in solidworks and parasolid makes expected fillet
I used Edge on the Box(50X60X80) for observation. First, use BRepBuilderAPI_Transform to translate the box, and then output the json data of the corresponding edges before and after the translation. Finally, use a special json reader to view the obtained json data. It is found that when theCopyGeom
Dear all, I have encountered a problem when using the BRepFill_Pipe function. I created a face that I want to sweep along a wire. Once, the wire is a straight line -- and that works -- and once the wire is a twisted helix -- that does not work. The runtime error that I get in the command BRepFill_Pi
Hi, when I cut a model with a plane, I get a bunch of edges all jumbled up. I try to sort them so that the start point of an edge matches the end point of the previous edge (preparation to create a polyline). But now, if the endpoint of the previous edge matches the endpoint of the current edge, I h
Hello, Boolean cut of shape A and shape B will form a new set of faces on shape A, such as the green highlighted faces in the attached picture, which may not be adjacent. I want to calculate the surface area of this set of faces. Is there any good way to do this? Best Regards!
I am working with a TopoDS_Face and have encountered an issue where a particular corner of the face is extremely narrow and sharp. When this face is rendered, a portion of this corner is missing, and the same omission occurs when the data is exported to a file. Are there any techniques or tools avai
Hello all, I'm trying to write a step to csg decomposition algorithm where I iterate over the faces in a solid and split the solid on the surface of that face but I'm not currently have any luck using the boolean operations. The boolean operations only return the original solid without any split. Se
Boolean operation is very expensive. In my case, it takes 29 minutes to make a Boolean difference. I want to start parallel calculation and speed up Boolean difference. I use mingw and msvc. How can I use it?
Based on the description on OCC website. Archived image: external image We are interested in understanding how much the triangulation time is reduced by Express Mesh compared to the open-source BRepMesh. For example, for the same TopoShape, with the same Deflection and Angular Deviation parameters,