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 1 of 17

Showing 60 discussions, ordered by the latest archived activity.

3 Parts Generation error

Hello, maybe this isn't the right place to write this but I currently face a very weird issue/bug and I think it has to do with the OpenCASCADE kernel modeling, but I would like for someone else to confirm that maybe using another design tool. I am creating 2 parts and 1 hole: I want to fuse part 1

0 replies2 files

Tesselation quality

There is a shape (.brep is attached) made of a torus surface and four 1-degree B-spline p-curves. 3d-curves generated by BRepLib::BuildCurve3d. Despite the fact that these p-curves are, in fact, iso-curves, the generated 3d curves are also B-splines. The rendering (tesselation) quality of this shape

0 replies3 files

HLRBRep_Algo

Occasionally, a segmentation fault occurs when executing the HLRBRep_Algo::Hide() method. Could you please tell me what might be causing this issue

7 replies3 files

How to build an arc wire without triggering precision errors

Hi, I have a closed 2D polygon data structure consisting of straight lines and arcs. Basically it looks like this: Start at (10, 20) Line to (30, 40) Arc to (50, 60) with 45° angle ... Line to (10, 20) Now I need to build a 3D shape by extruding this polygon in a reliable way. I already managed to d

3 replies

Problem of modeling with non-regular boolean operation

Hello all, I am dealing with non-regular boolean operation using the tool BOPAlgo_Cellsbuilder class. I found that in some situations the boolean operations will go wrong when dealing with complex shapes that have tiny parts. For example, I built 3 cones and tried to build a single branch with them

0 replies5 files

ShapeUpgrade_UnifySameDomain Infinite Loop

static 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(); TopoDS_Shape stepShape = stepReader

1 reply3 files

BOPAlgo_Splitter results

Hello! We are using BOPAlgo_Splitter to split a solid with a plane. The results are correct, for the special case the result is a compound of 3 solids. I want to logically group the results, e.g. in the attached image the red parts should be one shape (compound) and the orange shape should be one sh

0 replies1 file

Making prism from face compound results in negative normals excluding one face

I'm building an app with Rust and opencascade bindings, and I'm having an issue if I make a compound with faces and "extrude" it (calls BRepPrimAPI_MakePrism with the compound shape) it results in negative normals on each face except one. I know the normals are negative as if I invert the normals in

0 replies2 files

ShapeUpgrade_UnifySameDomain crash

Hello, The ShapeUpgrade_UnifySameDomain build gives me an error for the attached brep file. Is my input invalid? Or is this a bug in the OCCT? Also, is there some kind of validation I can do before unifying to prevent crashes? Exception thrown at 0x00007FF8920CC77C (TKG2d.dll) in application.exe: 0x

1 reply2 files

BRepBuilderAPI_GTransform Crash

Good afternoon, I am trying to stretch a topods_face (plane), but the BRepBuilderAPI_GTransform crashes: Microsoft C++ exception: Standard_ConstructionError error message: Geom_TrimmedCurve::U1 == U2 gp_Vec dir(0, -1, -0); gp_Pnt locOnPlane(800, 625, 183); gp_Ax2 xdir(locOnPlane, dir.Reversed()); do

2 replies1 file

AddThickSolid fails with overlapping facets when creating a shell around a tooth

Hello everyone, Goal: I want to generate a layer of constant thickness around lower root area of a tooth geometry (using OpenCascade through Gmsh), something like: Input: tooth volume Output: tooth volume + outer offset shell The upper crown region should remain untouched; The shell should only wrap

2 replies

Conical surface

I'm trying to make a conical surface bounded by two lines and a circular arc. Here is a sample code double h = 20.0; double a = 60.0 * (M_PI / 180.0); double dh = h * tan(a / 1.0); double r = dh; gp_Dir aDir(0.0, 0.0, 1.0); gp_Pnt aPnt0(0.0, 0, 0.0 ); gp_Pnt aPnt1(dh, 0, aPnt0.Z() + h); gp_Pnt aPnt2

3 replies5 files

BRepAdaptor_Surface: Remove TopoDS_Face restriction in one coordinate only

Hi, I'd like to remove a face restriction in one coordinate only: e.g. a half-cylindrical face would become infinite in its axial coordinate but still limited to the half circle in the other. Note the algo shouldn't be limited to cylindrical faces. I have this code TopoDS_Face face; //[...] BRepAdap

2 replies1 file

Edge points are different when evaluated from curves using params

I am using the following code - BRep_ListIteratorOfListOfCurveRepresentation itcr; Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) & edge.TShape()); const TopLoc_Location& Eloc = edge.Location(); const BRep_ListOfCurveRepresentation& aLCR = TE->Curves(); TopoDS_Vertex v1a, v1b; TopExp::Vertices(edg

3 replies

Intersection Shape - Plane via BRepAlgoAPI_Section: Missing Edge

Hi, I want to calculate intersections between a shape and parallel planes using BRepAlgoAPI_Section. As a result I want to get all intersection edges. This works correctly in most cases. Just in one case one edge is missing. The shape is not a solid, it consists of several (trimmed) faces, imported

0 replies2 files

Join few spline curves into one?

Is it possible to convert few sequential splines (curves) on the surface edge info one resulting spline (curve)? How to insert new resulting spline instead of sequence of spline in the CAD model? Thank you in advance.

4 replies

Problem of Projecting a planar sheet to a surface of revolution

Hello guys. I recently met a problem when using the BRepBuilderAPI_MakeFace. I was trying to project a planar sheet to a surface of revolution to create a small surface on the surface. I firstly decomposed the planar sheet into edges and then projected them to the surface, after this process I got a

1 reply3 files

BRepExtrema_DistanceSS does not work to find distance between Vertex and Sphere

Hello, I try to find distance between Vertex and Sphere using class BRepExtrema_DistanceSS . However, it does not work. Here is my code #include <BRepExtrema_DistanceSS.hxx> #include <BRepBuilderAPI_MakeVertex.hxx> #include <BRepBndLib.hxx> #include <Bnd_Box.hxx> #include <BRepPrimAPI_MakeSphere.hxx

0 replies

Projetion get wrong result

i project the shape with code: Handle(HLRBRep_Algo) hlrAlgo = new HLRBRep_Algo(); hlrAlgo->Add(shape); gp_Ax2 ax(gp_Pnt(0, 0, 1000), gp_Dir(0, 0, -1), gp_Dir(1, 0, 0)); HLRAlgo_Projector projector(ax); hlrAlgo->Projector(projector); hlrAlgo->Update(); hlrAlgo->Hide(); HLRBRep_HLRToShape hlrToShape(h

0 replies1 file

The capping result shows that some faces are not properly joined.

I have aligned the section plane along the axis and am attempting to split the model in half as shown in the first image: Viewer_Model.jpg. My goal is to obtain the section view from this. I was able to achieve this using the BRepAlgoAPI_Section class. After performing the sectioning, I retrieve the

2 replies3 files

Intersection polygon - plane

​ Hello, I would like to calculate the intersection of a polygon in a plane with a plane and find the resulting polygons, and I need to perform this calculation more than 150,000 times. I used the BRep APIs, but the calculation was too slow. So now I am using geometric APIs (GeomAPI_IntCS) to find t

0 replies1 file

Creating Smooth 3D Model from Multiple Profiles with Tangent Continuity

Hello everyone, I urgently need help. I need to create a 3D model from 4 different profiles (TopoDS_Wire). These profiles can vary slightly—for example, one profile may be longer than another. So far, I have managed to create a wireframe model that ensures the final model will be continuous by contr

3 replies1 file

BRepFill_PipeShell builds broken segments

Hi all, I'm trying to build a pipe with consecutive line segments as the spine, and a circle as the profile with BRepFill_PipeShell . The transition mode is BRepFill_Right . Following is the code snippet std::vector<gp_Pnt> pnts = { {-11.632049,994.694902,48.628134}, {10.065155,966.861115,-9.835286}

0 replies2 files

Non-regularized Boolean Operations

I have been investigating OpenCascade for non-manifold boolean operations. I have a couple cases that I'm struggling to get working and would appreciate any advice on how to accomplish what I want or a clearer explanation of OpenCascade's capabilities. I've read https://dev.opencascade.org/content/n

0 replies1 file

ShapeUpgrade_UnifySameDomain do good after save as STEP and reload it back.Why?

The ShapeUpgrade_UnifySameDomain does not work properly, but after saving the shape as a STEP file and then re-reading it back in, ShapeUpgrade_UnifySameDomain produces good results. The shape was obtained by using BOPAlgo_Splitter on several faces and a solid. Is there any issue with this shape? (W

4 replies2 files

Shaded with Edges - for STL

hi, I'm working on a Shaded with Edges version for displaying STL files in my program, but with sharp edges. My goal is to achieve edge display similar to CAD Assistant. I'm using the Open3D library, but my results aren't satisfactory. CAD Assistant - do you know how this is done? Maybe it uses an o

5 replies2 files

Geom_Surface::D1 and metric tensor

Hello, a surface has a parametrization x = x(u,v) y = y(u,v) z = z(u,v) The position of P on the surface S is (P-O) = x e_i + y e_y + k e_z in which e_i, e_j, e_k are the direction vectors in (O,x,y,z). The first fundamental form describing the metric of S is the square maxtrix E F F G in which E =

4 replies1 file

Extrude/Sweep of a solid?

Hola~ I have a TopoDS_Solid. I have a starting and ending location. I want to connect (word I would use is extrude) along a linear path between the start and end point of the solid. The sweep (and friends) all have exceptions so they do not work on solids. What is the right way to extrude a solid al

0 replies1 file

What are the subordinates of TopoDS_Shape

Does "solid" in OCC correspond to "body"? If I traverse the Solids under a Shape, and then iterate through the Faces within each Solid, will that give me all the Faces? I tried doing this, but the Faces I obtained were only a subset.

3 replies

OCCT 7.8.0 Geometric masking result is incorrect

BRepPrimAPI_MakeBox makeBoxxx(50, 50, 80); BRepPrimAPI_MakeCone makeCone(50, 25, 100); gp_Trsf trsfx1; trsfx1.SetTranslation(gp_Vec(-(50 / 2), -(50 / 2), -(80 / 2))); TopoDS_Shape Box = BRepBuilderAPI_Transform(makeBoxxx, trsfx1); gp_Trsf trsfx; trsfx.SetTranslation(gp_Vec(0, 0, -(100 / 2))); TopoDS

3 replies2 files

PLib_JacobiPolynomial_Data.pxx

I dont know where W(t) data come from. When Gauss Point Number is 20, They are as following from book: GaussPoint = [0.076526521133497338312 0.2277858511416450682 0.37370608871541954876 0.5108670019508271265 0.63605368072651502498 0.74633190646015079572 0.83911697182221878233 0.91223442825132594614

4 replies

How to Compare TopoDS_Shapes for Equivalence

I'd like to write some regression tests for my shape generation code. The idea is to read a gold standard BRep file and compare it to what the test code generates. I know that TopoDS_Shape::IsEqual simply compares the underlying TShape pointers for identity. Is there a method which compares two Topo

2 replies

Collapse of thin rhombic surface

Dear OpenCASCADE developers: is it possible to collapse very thin rhombic plane surface? Thank you in advance.

2 replies1 file

HLR mode for OBJ file

OBJ files do not contain BRep data; instead, they represent tessellated geometric data consisting of triangular information. I want to enable HLR mode for this, but when I run it, I get all the edges from the triangles. (First picture in Image "Sewing_before_after.jpg") To create a face from the tri

3 replies2 files

Bezier curve conundrums

I have a question relating to computation of bezier curves - rather showing my ignorance of maths I'm afraid... I'm working in 2D with points and bezier curves. I want the user to be able to insert a new point into an existing bezier curve - thus creating two curves which accurately mirror the shape

1 reply

Make Geom2d_BSplineCurve longer

Hello. I have some 2d bspline and I need to make it longer to a certain parameter value (for example, extend the start to -8, with a StartParameter value of 0). I tried to use the "Segment" method, but when it works, an exception occurs when executing InsertKnots if you specify parameters outside th

1 reply

Face Warping/Bending

I create 2D shapes defined as TopoDS_Face, created from points and BezierCurves. All is well in my happy little 2D world... But, I now have need to *bend* these 2D faces, in a single axis, from 90-360degrees. To explain, imagine a 2D rectangle bending around to create a pipe/cylinder shape (but not

0 replies

HLRBRep_Algo to Add a Sphere ,the result is empty.

I make a shape by BRepPrimAPI_MakeSphere,then perform my HLRProject function.The result is empty,no edge or vertex.Why?What should i do in HLRProject() function? TopoDS_Shape HLRProject(const TopoDS_Shape& shape, const gp_Ax2& viewingDir) { if (shape.IsNull()) return TopoDS_Shape(); Handle(HLRBRep_A

2 replies

Inside region is not always on the left hand (parameter domain).

Hi Guys, I was taught in school that the inside region of the polygon is always on the left hand of the edge. But after tracing many cases from different .iges files in OCC, I find that's not true. I mean the algorithm in BRepTopAdaptor_FClass2d doesn't suppose the left hand theory. Is my observatio

0 replies

The color problem of Boolean operation

In the Open Cascade, the Boolean operation Class need to input Topods_Shape. However the TopoDS_Shape doesn't contain color information. If the two topoDS_shape have differnt color, Can OCC keep the color after boolean operation? For example, I want to do boolean union of a red box and a green box.

4 replies1 file

BRepAlgoAPI_Common between custom solid and box loses triangles

A bit of context I am trying to do a common operation between a solid that I constructed from a list of triangles and a box. The solid represents a staircase. It is generated in another app, meaning I only have access to its list of triangles. The following c++ code generates the staircase as an OCC

0 replies3 files

Problem Tessellating Fillets

Hello everyone! When tessellating shapes with BRepMesh_IncrementalMesh we noticed that fillets on cylindrical or rounded solids have strange artifacts (see screenshots). This problem does not arise for rectangular base shapes (see last screenshot). We have tried several parameter combinations for De

4 replies7 files

Optimize performance of ray/face intersection computation

Hello, My application is performing ray/shape intersections computation using triangles and Octree to sort shape faces/triangles. It is pretty fast but I need to implement an alternative that provide more precision, so I try to use OpenCascade objects. TopoDS_Face bounds are stored in an Octree to q

0 replies

How to make GeomFill_Pipe object (NURBS) solid?

Hello, I am new to OCCT and struggle to find information on a possibly trivial problem. I think I managed to use GeomFill_Pipe to sweep between two circles of different radii along a parabolic path (in pyOCCT). Now I would like to convert this surface (it is a surface, right?) to a solid in order to

1 reply

BRepBndLib::AddClose crashes

I am attaching 3d shape for which BRepBndLib::AddClose is crashing with following callstack - My code - Standard_Real xMin, yMin, zMin, xMax, yMax, zMax; Bnd_Box bndBox; BRepBndLib::AddClose(shape, bndBox); Crash callstack:- ntdll.dll!00007fffc59e9d88() Unknown ntdll.dll!00007fffc59831f2() Unknown n

3 replies1 file

TopoDS_Shape::IsEqual

I make a TopoDS_Shape S, i.e. a cube.Then I write It on disk, by using BinTools. Finally I reload it from disk, and obtain S_reloaded. Is the returning value of S.IsEqual(S_reloaded) true or false? Grazie Author

2 replies

Time and memory consumption in Gmsh for OCCT operation

In Gmsh I create one point and apply a translate operation 10000 times. It takes 15 GB memory and 20 seconds. The Gmsh-5-lines script is attached (extension is changed from .geo to .txt). Gmsh 4.13.1 (OCC 7.7.2), Windows 10. Would you clarify, please, is it a problem of OpenCascade or Gmsh? Thank yo

9 replies4 files

Invalid shapes when BRepBuilderAPI_MakeWire is called (when using OCC in Gmsh)

Hello everyone and OCC team, The following script reproduces an issue while using Gmsh (please, follow the "FIXME" tag). It is a .geo file, so just change the extension to .geo. For a specific aspect ratio (see Dw = 0.001, line 12) of two geometry entities (i.e., a very tiny wellbore/cylinder within

1 reply1 file