DiscussionsIssue archiveModeling Data and Algorithms

Forum archive

Modeling Data and Algorithms

Technical discussions preserved from the public OCCT community forum.

Topics
968
Replies
2,403
Files
1,051

Discussions

Page 2 of 17

Showing 60 discussions, ordered by the latest archived activity.

After a bool operation between sphere face and box, seam edge makes error

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

0 replies2 files

HLR algorithm gives empty shapes for GLTF model.

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

15 replies9 files

Robust wire offset

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

0 replies

How to split a solid by some faces?

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

0 replies3 files

Performance Issues with BRepExtrema_DistShapeShape

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

2 replies1 file

find out if 2 shapes intersect without BRepAlgoAPI_Common

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

4 replies

Shape Type of Compounds with All Geometry Children

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

2 replies4 files

Getting Actual Object Type

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

0 replies2 files

Curve transformation

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

1 reply

Location different for Face

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

0 replies3 files

NURBS Surface Wires....

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

0 replies

Incorrect result when cutting a model with another model

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

4 replies7 files

Meshing Extrusions in 7.7.2

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

0 replies2 files

Merging cylindrical faces using ShapeUpgrade_UnifySameDomain

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.

0 replies1 file

gp_Lin::Distance maybe not perfect??

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

4 replies5 files

Plane's axis intersection with another plane

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

0 replies

Boolean cut has issues when it involves a common Edge between argument and the tool.

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

2 replies3 files

BOPAlgo_Splitter performances

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

0 replies

How to merge faces in open cascade so that the faces are meshed together

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

6 replies

SIGABORT/terminate thrown in AISInteractiveContent::SelectPoint()

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

4 replies1 file

BRep_Tool::Triangulation always IsNull

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 <

1 reply

BRepAlgoAPI_Fuse error?

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

2 replies3 files

BRepOffsetAPI_MakeOffset fail

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

3 replies2 files

Surface-surface intersection

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

0 replies

How to correctly read the shape resulting of BRepAlgoAPI_Common ?

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

0 replies

Faces are not properly created from wire data.

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

0 replies1 file

Process or Healing shapes for meshing

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

0 replies3 files

Smooth boundary

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

0 replies1 file

BOPAlgo_MakerVolume.

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++

0 replies2 files

BRepAlgoAPI_Cut operation results incorrect geometry

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

0 replies1 file

Geom_BSplineCurve incorrect poles

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

0 replies1 file

ShapeUpgrade_UnifySameDomain not working

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

3 replies2 files

Unrolling curve

This post can be deleted, I found an answer.

0 replies2 files

Handle(Geom2d_BSplineCurve) to TopoDS_Edge

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);

2 replies2 files

Sweep with reducing radius profile problem

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/

1 reply2 files

Suspect Volume Properties

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

8 replies1 file

OCCT-7.8 Hashing mechanism

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

6 replies

OCCT run in separate threads (multithreading is too slow)

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

13 replies1 file

BRepExtrema_ShapeProximity does not return all faces within tolerance

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

0 replies

Questions About BRepOffsetAPI_MakePipe

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

0 replies3 files

Has errors when executing BRepAlgoAPI_Common

Code in question: //read model from STEP file TopoDS_Shape readModel(const std::string& filepath) { STEPControl_Reader stepReader; IFSelect_ReturnStatus ret = stepReader.ReadFile(filepath.c_str()); Standard_Integer count = stepReader.TransferRoots(); Standard_Integer shapeCount = stepReader.NbShapes

0 replies4 files

Extract shape parameters from TopoDS_Solid or TopoDS_Shape?

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

7 replies2 files

Imprinting

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

0 replies

Create canonical surface limited by a wire

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

0 replies

Fillet on a solid fails

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

6 replies5 files

Why does the EDGE information become shorter after BRepBuilderAPI_Transform?

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

2 replies2 files

throwing an instance of 'Standard_NullObject' when executing BRepFill_Pipe

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

3 replies1 file

Reversed does not lead to expected result

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

6 replies

Could not get intersection for two overlapping circles

Code in question: #include <cstdio> #include <Geom2d_Circle.hxx> #include <Geom2d_Line.hxx> #include <Geom2dAPI_InterCurveCurve.hxx> #include <gp_Circ2d.hxx> gp_Ax2d make_axis2d(Standard_Real x, Standard_Real y) { return gp_Ax2d(gp_Pnt2d(x, y), gp_Dir2d(1, 0)); } int main() { gp_Circ2d gc1 = gp_Circ

2 replies

Get the new faces formed after Boolean Cut

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!

0 replies1 file

Removing Sharp and Narrow Corners in TopoDS_Face

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

1 reply

Splitting an solid using and surface of a face in the solid

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

2 replies3 files