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

Showing 60 discussions, ordered by the latest archived activity.

B SPLINE CURVE TO LINE EDGE

I want to use in my software Geom_Line edge. But when i see the type of Geom_Line edge, it is defined as GeomAbs_BSplineCurve edge. How can i use Geom_Line edge if it is kept as GeomAbs_BSplineCurve ? Thank you

1 reply

Is there any way to increase fusing of boxes ?

Hello Team, I have about 500 boxes created by BRepPrimAPI_MakeBox. I am fusing them box by box using - BRepAlgoAPI_Fuse. It takes about 30 seconds. Is there possibility to speed up the process ? Thank you in advance. With respects, Author.

5 replies

Point cloud generation

Hello, I'm new to OCCT framework. I have my application that needs point clouds. Can we use OCCT library or classes to read either IGES or STEP CAD file and generated surface point clouds, so that i can use that in my application. Thanks, Author

4 replies

Making pipe along curve from segments

Hello Everyone, I have some simple example - profile is small rectangle, spine is big rectangle. I want to build pipe along big rectangle. I use BRepOffsetAPI_MakePipe. I know it requires existence C1 on every point of spine. Nevertheless I try to build with spine as rectangle. I get good result on

6 replies

Trimmed Nurbs Surface

Hi, I am new to Opencascade and I hope that someone can help me with my problem: What I want to do is to read an IGES-File and export the B-Spline surface information of the created shapes (My aim is to use the spline surface information from Opencascade to create my own spline surfaces in an extern

4 replies

Close 4 sided hole with continuity

Hi All, I have this simple example where I want to close this hole of 4 edges using OpenCascade functions. I tried BRepOffsetAPI_MakeFilling which gives sort of a solution, but the problem is that it approximates the edges and uses the edges as trim edges. I would expect the end result to be a BSpli

3 replies7 files

BRepExtrema_DistShapeShape error

I wrote a subroutine to determine whether a given point lies on a surface: BRepBuilderAPI_MakeVertex vertexbuilder(p); //p is a gp_Pnt TopoDS_Vertex vertex = vertexbuilder.Vertex(); BRepExtrema_DistShapeShape extrema; extrema.LoadS1(F); //F is a TopoDS_Face extrema.LoadS2(vertex); extrema.Perform();

2 replies

Problem with parametric representation

Hello, I am new to this forum, so I hope that I have published this question in the correct place. I have been using gmsh for quite some time and have written the attached python code based on gmsh's use of OCC to create a geometry. There appears to be some problem with the way the 2D surface mesh i

2 replies5 files

Prevent IncrementalMesh crash

Say, I want to perform a cut operation on two boxes. How can I detect that a cut returns an empty region before I pass the constructed object to BRepMesh_IncrementalMesh? For a concrete case consider the following code that crashes. There the tool (second box) is larger the the object (first box): -

2 replies

Homography matrix

Hello, I'm taking different views of a TopoDS_Shape created from the reading of a STEP file. To do that, I'm moving the camera around X, Y and Z world axis establishing the look-at point (center view) always at the center of mass of the shape. Now I need to calculate the homogeneous matrix (4x4) tha

8 replies2 files

Point cloud generation

Hello, I'm new to OCCT framework. I have my application that needs point clouds. Can we use OCCT library or classes to read either IGES or STEP CAD file and generated surface point clouds, so that i can use that in my application. Thanks, Author

2 replies

Sewing: creation of common topology fails

When sewing two separate faces (see attachement), that share an edge geometrically, I won't get a common topology. As shown in the Dump of the sew.SewedShape() after sewing, the vertices are not merged, despite having the same coordinates (see the highlighted vertices). I tested nearly every possibl

1 reply1 file

Intersection with STEP model

Hi there, I'm trying to use the open cascade library to import a STEP file and then to create intersect points with the imported shapes using lines. For testing I created a simple STEP file with a simple cube which is attached to this post. I'm successful in retrieving the shape from the STEP file a

1 reply1 file

Accessing Poly_Triangulation for Shape after BRepMesh_IncrementalMesh

I am migrating from an older version to 7.4.0. My prior version code loads a TopoDS_Shape from STEP, performs BRepMesh_IncrementalMesh and then used STLMesh to iterate over triangles, mapping g_Pnts and implied edges into an adjacency graph. I can understand how to do this mapping with a Poly_Triang

1 reply

Comparing shapes

Hello, If I make two spheres: TopoDS_Shape Shape1 = BRepPrimAPI_MakeSphere(10); TopoDS_Shape Shape2 = BRepPrimAPI_MakeSphere(10); Shape1 == Shape2 returns false. Is there a method that compares two shapes to determine if they are equivalent? Thank you for any help, Mike

15 replies

Create a cone from simple geom shapes

I am looking for a way to create a solid cone shape based on the vertex point of the cone and an intersecting edge/wire created by the intersection of the cone and a plane. I have done this for cylinder with two planes (Geom_Plane) and a simple cylinder (Geom_CylindricalSurface). I then create two e

1 reply

Steps to turn Sewed Shape in to unified solid

Hi. I have a piece of code that builds a shape as follows : gp_Pnt p1(10,0,0); gp_Pnt p2(10,10,0); gp_Pnt p3(0,10,0); gp_Pnt p4(0,0,0); gp_Pnt p5(10,0,10); gp_Pnt p6(10,10,10); gp_Pnt p7(0,10,10); gp_Pnt p8(0,0,10); TopoDS_Edge e1 = BRepBuilderAPI_MakeEdge( p4, p1); TopoDS_Edge e2 = BRepBuilderAPI_M

3 replies4 files

Modifying sub shapes of a TopDS_Shape topology (using C# wrapper)

Hi there, I have loaded a BRep file and got a TopoDS_Shape out of it. Now let's say I want to move one TopoDS_Vertex around and afterwards this movement should effect the whole topology automatically (readjusted edges, wires, faces,...). How can I achieve this? I only got the single shapes as copy,

1 reply

How to get other data than simple shapes from brep (extrusion e.g.)

Hi everyone, I am trying to use OCCs (own?) BRep Format for data exchange. I found that when I store (for example) an extrusion made with " Geom_SurfaceOfLinearExtrusion", it is stored in a BRep file as extrusion (not like when I do it with makePrism but thats not the point). My question now is, how

2 replies

Creating a non planar face without BSplineSurface

Hey, I have an application where I want to edit vertices / edges of a TopoDS_Shape. In some cases the TopoDS_Face of that I modified the edge/vertex is after that modification non planar. I tried to fix that with 'GeomPlate_BuildPlateSurface' and got a BSplineSurface, but that is not how I want it.

2 replies

Upgrading to 7.4 with respect to deflection changes

I noticed my meshes are not looking as good in 7.4 as in 7.3. The release notes for 7.4 say, "In the new version deflection is controlled more accurately. Due to this improvement it may be necessary to tune parameters of call of the BRepMesh algorithm on the application side to obtain the same visua

7 replies

merging coplanar faces

hello, is there a simple way how to merge connected coplanar faces of the shape? (in general - to merge one-surface faces) best regards, Author

2 replies1 file

BOP Cut fails depending on edge tolerance

I'm using OCCT 7.2.0. I'm trying to make "complement" face from original face on the base surface in my project. In here, the "complement" means to cut out the original face area from the base surface, like a cookie-cutter. To do that, I'm using BOP Cut operation, but it makes sometimes unexpected r

3 replies6 files

Creating an ellipsoid from a sphere with a transformation function applied

I am trying to create an ellipsoid by starting from a unit sphere and then apply a translation function to it. To find this translation function I compute the eigenvalues and vectors of the target ellipsoid and find the transformation function from those. Let's say want an ellipsoid at center = {0,

2 replies1 file

How to merge all the TopoDS_Shape?

Hello, I read a iges a file, When i opened this file using CAD Asistant I see 94 subshapes. Every face seems as a shape. Although i made a Compound with that shapes(BrepBuilder) , i can not find adjacent face. TopExp::MapShapesAndAncestors(shape,TopAbs_EDGE,TopAbs_Face,MapOfShape); bool found=TopOpe

4 replies

Convex decomposition

Is there any functionality to take a TopoDS_Shape and decompose it into convex or nearly convex subshapes prior to triangulation? In particular, I'd like to take a TopoDS_Shape and put it into the Bullet Physics SDK for high-performance collision detection.

1 reply

Triangulation of an entire TopoDS_Shape

I'm using 7.4.0 . I'd like to take a TopoDS_Shape and convert it to a reasonably coarse triangulation- one in which smaller faces are entirely glossed over. Imagine a shape which includes everything down to the threads for a small screw; ideally I'd like to have a triangulation which ignores those t

2 replies

Duplicate points found when iterating points of a face

I'm trying to iterate the points of each selected planar face in a viewer. A crude example of what I'm doing is shown in the code below: for (aisContext->InitSelected(); aisContext->MoreSelected(); aisContext->NextSelected()) { Handle(StdSelect_BRepOwner) owner = Handle(StdSelect_BRepOwner)::DownCas

2 replies

How to correctly calculate center of mass for an ellipse

I am new to opencascade and I try to add an ellipse to cadquery ( https://github.com/CadQuery/cadquery ), a python lib using pythonocc. The way it works is that the ellipse is created, however the center not saved. Later in the modelling process, if you want to start from the center of the ellipse,

0 replies

Boolean operation fails, but succeeds when I/O TopoDS_Shape as BREP before

Hi everyone, I'm using BRepAlgoAPI_Common to compute the common part of two TopoDS_Solids, which consists of some B-Spline-, planar and cylindrical surfaces created at runtime. In a specific case, the Boolean operation fails although the geometries are well prepared (as in other cases which work wel

5 replies

IncrementalMesh crash with Common generated surface.

I have two boxes touching at a part of the boundary. I can compute the intersection (BRepAlgoAPI_Common) but when I try to mesh the surface I get a crash. Perhaps some sees what I am doing wrong? Does the intersection perhaps return both intersecting faces from both boxed and I need to merge them so

4 replies

incmesh freeze with fused tori

occt 7.4 debian/buster following never finishes inside test harness pload MODELING ptorus t1 10 2 ptorus t2 10 2 ttranslate t2 0 20 0 bop t1 t2 bopfuse f1 incmesh f1 0.2

4 replies

How to fuse face and face by OpenCascade V7.4.0?

Hello. I am trying to fuse face and face by following codes, but it is not working. I use OpenCascade version 7.4.0. BRepBuilderAPI_MakeWire makeCheckWire; makeCheckWire.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 0.0, 0.0, 0.0 ), gp_Pnt( 0.0, 0.0, 100.0 ) ) ); makeCheckWire.Add( BRepBuilderAPI_MakeEdge(

8 replies2 files

(u,v) grid of a face extends beyond its edges

I have a face (Geom_BSplineSurface) and I want to draw points or lines in a sort of grid pattern inside that face. I tried getting the bounds of the face and simply iterating through that (from min to max); I also tried creating iso lines (with ​ShapeAnalysis_Surface::UIso and VIso). In both cases,

1 reply1 file

Issue generating aligned meshes for stacked solids

I have two flat solids stacked directly on top each other (one which is an identical copy of the other). The non-matching side boundaries are curved and the meshing creates slightly different point distributions on the top an bottom edges so that the meshes on the shared interface doesn't match up.

1 reply2 files

How substitute BRepMesh_ShapeTool::Bound()

Hi all, I am been converting a project from OCC6.6 to OCC7.3, and I cannot find the method BRepMesh_ShapeTool::Bound(). How can I replace this method to get the bounding box of shape ? Thanks,

1 reply

Discern between smooth and sharp edges in triangulation

Hello, I'm looking for a way to discern between smooth and sharp edges in a triangulation. At the moment, I take the triangulation of each face of a solid like this: TopoDS_Face actFace = TopoDS::Face(actExp->Current()); Handle(Poly_Triangulation) facing = BRep_Tool::Triangulation(actFace, Loc); I t

3 replies

confusing occt 7.4 mesh results with compound

I created a test here on debian buster with occt 7.4 that is confusing me. I think there is a bug when meshing through a compound. The relevant code is below. It consists of 2 tests that create a rectangular wire on the yz plan and then instance that wire along the xaxis twice. 'Test00' runs each wi

1 reply2 files

Iusses computing a cut from a prism and a sphere.

In the code bellow I cut a sphere from a prism. In one particular setup this does not return the expected cut but the complete prism with a arc from the intersecting sphere on it's surface. My question is if the cut generated with gp_Pnt origin = gp_Pnt(1,0,0); is expected on and if so how would one

1 reply1 file

can anybody introduce data structure to Geom_BSplineSurface

I have some requirement to develop a program using NURBS surface, so I need to transfer data into OCCT there are 9 input parameters for the construction function of Geom_BSplineSurface class, they are const TColgp_Array2OfPnt& Poles, const TColStd_Array1OfReal& UKnots, const TColStd_Array1OfReal& VK

2 replies

Intersect surface with plane

Hi, I'am finding a function that intersect a set of surfaces with a plane. The surfaces to be intersect could be trimmed or untrimmed. The result of course are the intersection curves between plane and surfaces. On the documentation of Open Cascade I found 3 functions that could make this operation:

3 replies

Unrotated circle axis

Hello, I have read step file and rotated all faces around an axis and then exploring edges belonging to a particular face with TopExp_Explorer. gp_Trsf trsf; trsf.setRotation(axis,angle); BrepBuilderAPI_Transform transform(face,trsf); face=TopoDS::Face(transform.Shape()); I rotated all the faces in

3 replies

How to detect that 2 Faces share a same Edge or a common Edge part

Hello the community, As said in the subject, I would like to be able to detect if 2 Faces (or their underneath support surface) share an entire (or piece of) Edge (or underneath curve). In case of partial sharing, I would like to get the range of parameter that is in common. I would appreciate any h

1 reply

create face from curves/wires

Hi, I have the following situation. I load some points which describes closed curves. I give the points to the PointsToBSpline algorithm to get the curve. TColgp_Array1OfPnt arr(0,points.size()-1); for(unsigned int i = 0;i { arr.SetValue(i,gp_Pnt(points[i].X(),points[i].Y(),points[i].Z())); } auto s

9 replies

Problems with BRepBuilderAPI_MakeFace and wire with Bezier curve

Hello, I tried to use a wire containing some edges with Bezier curves to make a face with BRepBuilderAPI_MakeFace (in version 7.3.0). Unfortunately, the resulting face does not have the smooth Bezier edges, but jagged edges consisting of straight sections. But the wire itself has the smooth Bezier e

3 replies

Fillet on shape with edge produced from BRepAlgoAPI_Cut operation

Hi everyone, I want to apply fillets in TopoDS_Shape that produced from other basic shapes with the help of BRepAlgoAPI_Cut. I have include the code and some pictures QString params = "27.2;21.7;28.6;28.6;2.8;2.8;11;20;15"; std::vector<double> parameters = splitParams(params); double outDiaMain = pa

4 replies3 files

Cut hole in B-Spline-surface

Hello, I'm experimenting a bit with cutting a hole in a B-Spline surface. I'm facing the problem, that I don't get the surface with the hole. I use DRAW: #load face s1 and cutter s2 restore s1.brep s1 restore s2.brep s2 #get wire for hole in parametric space of the surface bop s1 s2 bopsection r exp

1 reply3 files

Concept for changing shapes after their creation

I would like to develop a rather simple modeling tool similar to SketchUp but less functionality of course. I've read the tutorials, user guides, code samples and already played around with code but I have the impression that I still don't understand some major concept, that is changing a shape afte

2 replies

trim Geom_BSplineSurface with wire

I am trying to trim a Geom_BSplineSurface with a wire in this way: BRepBuilderAPI_MakeFace faceMaker (bsplinesurface, 0.001) ; BRepCheck_Analyzer brepCheckWire(wire) ; if( brepCheckWire.IsValid() ) { faceMaker.Add(wire) ; } TopoDS_Face aFace = faceMaker.Face(); ShapeFix_Face aFaceFix(aFace); aFaceFi

0 replies2 files

Vertices of my cylinder are wrong

Hello, I'm generating a cylinder with this: BRepPrimAPI_MakeCylinder aMakeCylinder = new BRepPrimAPI_MakeCylinder(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), 1, 1, 0); TopoDS_Shape myBody = aMakeCylinder.Shape(); and then i'm extracting the vertices: public static List<List<gp_Pnt>> toVert

4 replies4 files

cut opération doesn't work

Hello, I can't manage to make the cut operation work. Any idea ? thanks in advance // my initial cylinder from which i'll remove another cylinder BRepPrimAPI_MakeCylinder aMakeCylinder = new BRepPrimAPI_MakeCylinder(new gp_Ax2(new gp_Pnt(0, 0, 0), new gp_Dir(0, 0, 1)), myRadius, myHeight, 0); TopoDS

6 replies1 file

Display a Sequence of Faces

Hello, I have a propriertary file format which stores a 3D object by its faces. Every face is its own section in the file and contains the edges displayed by the coordinates of its points which will construct the faces. I was able to extract all the vertices from the file, create the edges, wires an

5 replies

How to get the unique vertices for a shape

Hello, I want to get all unique vertices from a shape. For example, if we consider a box, it has 8 vertices. I want to get the 8 vertices values. I used the following codes. However, it returns 48 vertices (6 faces * 4 wires in each face * 2 vertices in each wire). TopExp_Explorer ex; Standard_Integ

1 reply

Volume with extrudable shape

Hi, I'm completely new to Open Cascade. I would like to know if the SDK allows to write a code that automatically recognizes if some volume body has an extrudable shape. If it recognizes a volume with extrudable shape, it should return the IDs of the source and targe surface that would represent the

7 replies

Question about collision detection

Hello all, I have some question about the usage of the collision detection with BRepExtrema_ShapeProximity() I can use only shapes that have brep data (loaded from iges or step or internally built) and that can be triangulated with BRepMesh_IncrementalMesh(). If the shape don't have the triangulatio

1 reply

BRepFeat_SplitShape split Irregular TopAbs_FACE

I want to split an Irregular TopAbs_FACE,the aS1 is an Irregular TopAbs_FACE and the aS2 is formed by four TopAbs_FACE(colsed). the aInterCurve2 is a Closed curve which are formed by four TopAbs_EDGE . I add the four edge and face to the split ,however ,An Exception Thrown in Split2.Build(); I don't

4 replies

Creating an adaptor surface for a cut face

Greetings, I have a cut face(cutface.png) which I need to access in the parametric space. The original surface is the shell without the holes cut into it. I build the adaptor face as follows: adpatedface = new BRepAdaptor_Surface(TopoDS::Face(cutface)); When I try accessing: adaptedface->Value(u, v)

1 reply1 file