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

Showing 60 discussions, ordered by the latest archived activity.

GeomAPI_PointsToBSpline 10x slower going from 7.5 to 7.8

It seams that, updating from 7.5 to 7.8 (0141024df595cdc8db3004927ca48c249776603b) fitting a spline through points has become 10 times slower. Here is the small code fragment GeomAPI_PointsToBSpline GeomBSplineFitter(Points, DegMin, DegMax, Continuity, Tol3D ); Handle(Geom_BSplineCurve) curve = Geom

6 replies

Divide a solid face into multiple faces

Hello, I want to split a face of a solid into multiple surfaces using Python to establish boundary conditions for further simplified modeling in the FEM environment. With OpenCascade 7.7.2 in Python, we were able to create a 3D model of soils from a point cloud, but we couldn't divide the face of th

0 replies

The issue in sweep perpendicular to the path.

Hi community, I'm encountering difficulties in maintaining tangency between edges and ensuring the correct orientation of the sweep profile in a path constructed with a combination of line segments and arcs. Additionally, there seems to be a problem with transitioning between cross-section shapes. I

3 replies3 files

Create a Spine for BRepOffsetAPI_MakePipe. How to Round the Vertex of a Wire?

Hello everybody, I want to create a Spine for building pipes with MakePipe, but I need that my wire has round transitions between the edges of the Wire. What is the Tool for doing that? Edit: I want todo exactly this: https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/curve/... Best R

0 replies

Help in intersection between wire and plane

Good afternoon, I am trying to find the best way to find the point of intersection between a wire and a plane (perpendicular). I have tried 2 different approaches: - using the BRepAlgoAPI_Section . This provides the correct result but it takes around 40s to execute 800+ intersections - using GeomAPI

2 replies1 file

Seeking Help with C2065 Error in C++ Code

Hello everyone, I'm currently encountering an issue with my C++ code while using the OCCT (Open CASCADE Technology) library. The error I'm receiving is C2065, indicating that "Poles" is an undeclared identifier. Here's the code snippet that's causing the problem: #include <iostream> #include <TColgp

6 replies

How to Fillet a 3D-Polyline?

Hello everyone, BRepFilletAPI_MakeFillet tells me no suitable edges for champfer or fillet 1. Is this function also making Fillet of a 3D-polyline? if not, what is the Class for doing that? 2. If is the proper function, how can I debug my problem? I have tryed with a closed Wire and open wire, but a

0 replies

BRepTools::OuterWire returns wrong wire

Hello, I have a face including four holes from which I need the outer wire but BRepTools::OuterWire returns the wire of one of the holes as outer wire. The face seems sound to me. Is there anything I can do so it return the correct wire or is it a bug? Tested with 7.6.1 and 7.8.0 Kind regards, Dirk

3 replies1 file

Shape ortogonal to Wire not working for me in BRepOffsetAPI_MakePipeShell

Here is my code: gp_Ax2 circleAxis(gp_Pnt(0, 0, 0), gp_Vec(1, 0, 0)); Handle(Geom_Circle) circle = new Geom_Circle(circleAxis, 20.0); TopoDS_Edge circleEdge = BRepBuilderAPI_MakeEdge(circle); BRepBuilderAPI_MakeWire wireMaker; wireMaker.Add(circleEdge); TopoDS_Wire circleWire = wireMaker.Wire(); Top

0 replies1 file

Errors in making an altered copy of a face

Hi All, I've got a cylinder face which has inner holes in it, and I want to make a copy without the holes. So I did the following: TopoDS_Face myFace = ...; TopoDS_Wire outerWire = BRepTools::OuterWire(myFace); Handle(Geom_Surface) surf = BRep_Tool::Surface(myFace); BRepBuilderAPI_MakeFace makeFace(

0 replies1 file

How to add solid thickness to closed shell?

Hi community, I want to know how can I make a thick solid from a closed shell? For example, If I have a cylinder which is a closed shell, then how can I make it as a thick solid? I know I can make thick solid from an opened shell using BRepOffsetAPI_MakeThickSolid API. Thanks in advance.

0 replies

Difference of BRepPrimAPI_Make* and gp_*

Hi there, I'm fairly new to this framework and I don't really understand the difference between BRepPrimAPI_MakeCone and gp_Cone or BRepPrimAPI_MakeCylinder and gp_Cylinder. Of course they are different classes, but pratically what difference does it make which Package I use? Especially because I ca

2 replies

Converting TopoDS_Face to BSplineSurface

Hi, I am trying to convert faces to BSplineSurfces and run into a problem I do not understand. Imagine a cone. We have two faces, the pointy hat and the closing disk. My code works just fine for the pointy hat but for the disk I get a flat rectangular surface, as if the surface is not constrained. H

1 reply2 files

BRepAlgoAPI_Cut -> SimplifyResult -> Crash!

Hi geniuses! ;) This code: BRepAlgoAPI_Cut* cut = new BRepAlgoAPI_Cut(initialShape, appliedShape); if (!cut->IsDone()) return false; cut->SimplifyResult(); sometimes just crash with access violation like this: Exception thrown at 0x00007FFB21102D12 (TKBRep.dll) in cad.exe: 0xC0000005: Access violati

10 replies2 files

Wire/Edge orientation bug?

I'm iterating over all wires for a given face and then iterating over the edges within each of the wires to build local loop definitions consisting of an ordered set of edges and their relative orientations. Though the resulting edge ordering appears correct, the query for the edge orientation seems

0 replies2 files

Collapsed Edge Removal

The attached model (zipped step file) has two collapsed edges. These are of zero length and start and terminate at the same vertex object. Is there some way these can be removed from the model with the result still valid? If so, how might I do this and what, if any, are the caveats to doing so? Than

0 replies1 file

Disturbances ( torsion ?) when building a pipe with BRepOffsetAPI_MakePipe

Hello, I'm trying to build a pipe by providing a spline (transformed into TopoDS_Wire ) as Spine, and a quadrilateral TopoDS_Face as Profile. The resulting pipe is regular over the first half of the spine's path (at least it corresponds to the expected shape), then undergoes perturbations at the end

0 replies1 file

GeomLProp_SLProps sometimes doesn't calculate normals...

Hi guys! Why GeomLProp_SLProps sometimes return false from IsNormalDefined() ? It's depended on IMeshTools_Parameters? or on resolution or on derivations? Ordinary, this happens on sharp conical 3D models. Handle(Geom_Surface) surface = BRep_Tool::Surface(m_occtShape); static const double resolution

3 replies

Mirror Transform and Reversed Faces

I start with a solid that is a basic box. I create a reflection transform with gp_Trsf::SetMirror. I then use BRepBuilderAPI_Transform to copy/reflect my box. The result has Geom_Plane's with normals facing into the box and the TopoDS_Face's are not reversed. However the wires have right handed orie

1 reply

Check whether the segment lies inside the surface (flat face)?

Hi guys! How to determine that the 3d segment (Geom_TrimmedCurve/TopoDS_Edge) lies on the plane of the flat face (TopoDS_Face) and is completely inside it (inside boundaries of face)? I know how to do this mathematically, but maybe there is some ready-made tool like BRepClass3d_SolidClassifier, only

0 replies

Solids improperly translated at import

When importing a multi-part model, the relative positions of the solids are incorrect (see images: gear1 is taken after importing the model into FreeCAD, and gear2 after loading the same model into my program). Can anyone suggest what I might look at to recover the proper orientation of the imported

8 replies4 files

Cylinder contour in CAD Assistant

Hello, When I iterate inside the elements of my CAD, I see that cylinders contains an interior edge (2) to join the top closed edge (1) and the bottom closed edge (3). Same work piece in CAD Assistant does not show the interior edge. Does CAD Assistant discriminate the interior edge to only display

1 reply2 files

Cylinder contour fix

Hello, I have a hole in a workpiece that does not result in a "clean" contour. In the image we see that the top edge is slit in two parts (1 and 2 in the picture), making our post-processing difficult. Is that to be expected ? Is there a ShapeFix to fix this ? In CAD assistant it seems to "display"

0 replies2 files

BRepOffsetAPI_MakePipeShell fail to create a solid

Hello everyone, I would like to ask for some advice. The attached picture shows a total of 6 models, 1-6. 1 and 2 get a solid 3 through BRepOffsetAPI_MakePipeShell 4 and 5 can only get a shell 6 through BRepOffsetAPI_MakePipeShell Note 1)6 model, which has a face at the marked 7 position. 2)3 and 6

0 replies2 files

The result of BRepOffsetAPI_MakeOffsetShape is different for the same input values.

I am using version 7.5.0. I implemented it with the attached file as follows. BRepOffsetAPI_MakeOffsetShape brepOffset; brepOffset.PerformByJoin(InputShape, Values between 1 and 9, Precision::Confusion()); ResultShape = brepOffset.Shape(); I performed a cut with the BRepAlgoAPI_Cut function based on

2 replies1 file

Cut a box with a plane

Hello, I tried to cut a shape with a plane but none of the methods I use works. Maybe I use it wrong. Below you find the three methods used and the problem with witch of them. Method 1 // METHOD 1 TopoDS_Shape S = BRepPrimAPI_MakeBox(gp_Pnt (-100, -60, -80), 150, 200, 170); gp_Pnt point(0, 0, 20); g

6 replies3 files

failed to fillet with a shape

Hello everyone, I would like to ask, the fillted of the two edges marked in the attached picture failed. I modified different radius, but it still failed or the fillted model was strange. Why is this? Is there any way to make the fillted successful? Below is my code: BRepFilletAPI_MakeFillet aFillet

2 replies5 files

Tracking Edge after transformation

hi, Please tell me how to track Edge before and after transformation: gp_Trsf translation; translation.SetTranslation(vec); BRepBuilderAPI_Transform transform(faceToMove, translation, false); faceToMove = TopoDS::Face(transform.Shape()); I need to know Edge e1 number=1 before transformation, and I h

0 replies1 file

BRepAlgo_Common is not thread-safe

Hello OCCT Community, In our project, we have developed an algorithm that scans all TopoDS_Shape objects (mainly imported from STEP files), check if there are any overlaps (non-empty intersection) among any two objects and send a warning to the user accordingly. The easiest way we found to implement

3 replies

How to create a face/surface from the points

Hello Everyone, I am very new to OpenCascade and also have basic knowledge of CAD: I am using PyOCC for modeling simple surfaces from the points. I was trying to convert the points into faces. Below is the code I have written. I dont know where I am going wrong.Can anyone help me with this. from OCC

4 replies

BRepExtrema_DistShapeShape miss intersect point between two curve

Hello everyone, I would like to ask. I use BRepExtrema_DistShapeShape to calculate the intersection point of two curves, but only one intersection point is obtained. I tried two versions, 7.5.0 and 7.8.0, but could only get one intersection point. But using BRepAlgoAPI_Section to process two curves,

4 replies2 files

Edge discretization

Been attempting to use BRepMesh_IncrementalMesh() to generate a discrete representation for a TopoDS_Edge. For linear edges the node count obtained is 2 which is as expected, but I'm looking for something finer than this though not necessarily uniform for a given edge. Is there an approach that will

0 replies

Problem when creating a shape

Hi everyone, i need to create a shape that is similar to a section of a cone with parametric top and bottom radii, angles and heights. This is the code i use use to build it: TopoDS_Face makeBaseFace(const gp_Ax2& refSys, const Standard_Real bottomAngleDegrees, const Standard_Real bottomRadius, cons

0 replies3 files

Wrong Shape from the BRepAlgoAPI_Cut.

Dear All, I found there might be a problem of the BRepAlgoAPI_Cut algorithm. For 2 spheres,s1 and s2: s1=BRepPrimAPI_MakeSphere(gp_Pnt(0,5.5,18),4.0).Shape() s2=BRepPrimAPI_MakeSphere(gp_Pnt(0,4.5,14),1.0).Shape() as shown in pict1. when I cut the s2 from s1 using the BRepAlgoAPI_Cut and got the sha

3 replies3 files

BRepExtrema_ExtCC crash issue in OCC 7.7.1 and OCC 7.7.2 upgrades

In OCC 7.7.1 and 7.7.2 upgrades, I encountered a crash in BRepExtrema_ExtCC. In OCC 7.6.0 BRepExtrema_ExtCC worked with no issue for the same two edges. In OCC 7.7.1 and 7.7.2 upgrades, is there any alternative api for BRepExtrema_ExtCC or is there a way to avoid this issue ? Here I have attached th

3 replies4 files

Can't Split two Objects

Hi - I need to produce a triangulated surface description from solids in a step-file. Often there are shared and touching surfaces. I have been using MakeConnected extensively to handle such surfaces, and also tried using Splitter. However I have found cases where this results in faces being exclude

0 replies2 files

How to obtain the intersection lines between a face and a sphere?

"Hi, I'm a beginner in OCCT. I would like to obtain the intersection lines between a face and a sphere, as shown in the attached image. My face model is in PLY format. How can I convert it to a data format that OCCT can handle? I've tried searching for examples of surface intersections, but haven't

0 replies1 file

Get the enclosed area formed by the four face

As shown in the figure, imagine the four rectangular faces as four walls. I want to get the enclosed area formed by the four walls. TopoDS_Face f1 = BRepBuilderAPI_MakeFace(w1); TopoDS_Face f2 = BRepBuilderAPI_MakeFace(w2); TopoDS_Face f3 = BRepBuilderAPI_MakeFace(w3); TopoDS_Face f4 = BRepBuilderAP

0 replies1 file

Retrieve Solid Objects form Shell

Hi, Maybe I'll interest you in my problem to solve? Here is the file Step -> czesc2.txt - it is called txt because you cannot insert anything else for download. It is a box, and like every box it has walls, and the walls of objects have their own face and thickness. It's all saved in one file that c

8 replies3 files

FEM Analysis with OCCT

Hi guys! Is there any functionality in OCCT for performing strength/rigidity (and other) analysis using the finite element method (FEM)? Maybe there are some built-in FEM solvers? How does FreeCAD do this?

2 replies

how to verify 2 faces share one same edge

For any 2 faces that join at one edge, I usually iterate each edge edge1 from face 1 and edge2 from face 2, and then make a comparison by using the below code: edge1.TShape() == edge2.TShape() or edge1.IsPartner(edge2) It doesn't work as expected always, as sometimes the edges' TShape do differ, eve

4 replies

Face and Edges after rotation

Hi, May i Ask for help with Face after rotation and moving? It creates new object Face and it lost information which Edge before is Edge after. How to distinguish them, and know which is which? Thank you for help Author

4 replies

error in calculating the shape volume

I used the below code to get the shape volume: GProp_GProps volumeProps; BRepGProp::VolumeProperties(m_shape, volumeProps); Standard_Real v = volumeProps.Mass(); However, the result is a minus, "-1306". I guess it's due to the "m_shape" I input, but I don't know what's wrong with it. Can anyone help

5 replies1 file

Bend the plane according to the trajectory line

I need some help with surface modeling, if I have a TopoDS_Face and a reasonable trajectory line (curve), how can I bend this face from a side angle according to this trajectory line to get a curved surface model. (This foundation plane does not have tensile properties, please do not use the stretch

1 reply

Using OCCT for modeling of milling processes

Hello Open CASCADE Community, I'm currently working on a machining process simulation using OCCT and employing B-Rep modeling for material removal. The project demands numerous complex boolean operations, and I've reached a stage where strategic insights are much needed. Here are the key questions I

0 replies

BRepAlgoAPI_Defeaturing never finishes

Hello everyone, When I use BRepAlgoAPI_Defeaturing to remove a small face (created by BRepFilletAPI_MakeFillet), the BRepAlgoAPI_Defeaturing never finishes even with timeout setting, it loops in IntTools_BeanFaceIntersector::ComputeLocalized with huge amount of surface ranges (20355, 40000+...) Tese

2 replies2 files

ProjLib_CompProjectedCurve Find Maxima Point

Hi, I find it searches both maximum and minimum solution of searching initial point. Is that a special reason to search both maximum and minimum solutions? It slows down overall solution then. In code ProjLib_CompProjectedCurve.cxx:InitialPoint, it can set flag to Extrema_ExtFlag_MIN. aExpPS.SetFlag

0 replies

BRepOffsetAPI_ThruSections fails

Thrusection API fails when i try to use thru section for attached list of wires. It works when the last wire is removed which is a full circle. I have attached BRep files of set of wires that i have used for this.

4 replies1 file

Splitting and splicing splines

I am dealing with a condition where I have an edge with a 3D periodic curve and a 2D pcurve on a surface. The pcurve isn't periodic but it is on a periodic surface and the start and end points are the same ignoring the period delta. The pcurve is a spline. The edge has a range end which passes the p

0 replies

Where is a transformation stored in a TopoDS object?

I am trying to understand where a transformation of a given object is stored. Any hints? For example, the following code creates and scales the edge: gp_Trsf scaling_trf; const gp_Pnt tpnt(0, 0, 0); scaling_trf.SetScale(tpnt, 0.1); // Create geometry gp_Pnt pnt (0., 0, 0); gp_Pnt pnt1 (10., 0, 0); a

1 reply

minimum distance between two curves

Hello together, how can I use OCC to calculate the minimum distance between two curves, as in the picture? GeomAPI_ExtremaCurveCurve calculates the distance between Extremas.

5 replies2 files

TShape modification (and general ownership and lifetime questions)

We require a mutable type of "path" (both 3d and 2d) where i can split or add and modify segments. These operations should be very lightweight. It seems that the BRep internal TShape types are immutable after creation and not the correct facility? What is the best way to archive this, or should we b

2 replies

delete or remove duplicates edge at the same location

hello... attached is my wing design script. however, multiple edges are created as a result of extrusion of the airfoil and fusion, is this a normail behavior? If yes, there any way to go around it? I added the image generated.

0 replies2 files

Can't triangulate a FACE

Hello, I've problem with a face triangulation. I'm using the newest OCCT v7.7.2. It's model of Ninja H2 motorbike. I've extracted the problematic part in CAD Assistant, the handlebars (model NinjaH2_handlebars1.step in the attachment): Archived image: external image Concretely it's this part: Archiv

2 replies5 files

Remove an extra edge on a cylindrical face

Hi people! Is there a way to force BRepPrimAPI_MakePrism not to generate this edge on cylindrical faces? Archived image: external image

1 reply2 files

How to transform

I am using the below code, but it is not doing the actual transformation. Please say how to use transform correctly: ``` gp_Trsf transformer = gp_Trsf(); transformer.SetValues(0.5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0); gp_Ax2 axis(gp_Pnt(0, 0, 0), gp::DZ()); TopoDS_Shape cone = BRepPrimAPI_MakeCone(axis

2 replies

Scaling U and V values of Geom objects

Hi, to match a specific geometry (with dimensions) to a simulation mesh (dimensionless and normalized) I tried scaling the model. When using: BRepBuilderAPI_Transform scaling(shape, scaling_trf) The shape is correctly scaled, as expected, the UV values, however, are still in the original size. Later

0 replies