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

Showing 60 discussions, ordered by the latest archived activity.

fail to use BRepOffsetAPI_ThruSections to build a loft

When I use this function to generate a loft, if the constructed polygon is a concave polygon with a large concave angle, the loft will fail to be constructed. When I debug it, the program throws exception: Unhandled exception at 0x00007FFD7FB8CD29 (in MyOCCT.exe): Microsoft C++ exception: Standard_C

0 replies

How to Interrupt BRepAlgoAPI_Cut ?

I use OpenCascade V7.4.0 for windows 32bit. I tryed to get shape difference by BRepAlgoAPI_Cut , but the process of BRepAlgoAPI_Cut constructor is not return. My application memory keep growing from 100MB to 1.5GB and finally my application crashed. [MyCode] BRepAlgoAPI_Cut cut( shapeBase, shapeCut)

4 replies4 files

Cutting/Trimming a 3D surface builts on BpreFile Function

Hello, I have 3D cloud points that are annotated from computed tomography images. In OpenCasCade, I want to do the following: 1. Make a 3D parametric surface that passes through all points with a predefined threshold. 2: After having the 3D surface, I want to trim in two steps. Initially, I want to

0 replies

Get a value when debugging...

hi, may i ask for help? when i debugging and check my variable it is hidden for me, how to display it? Thank you Author myData[theIndex].entity->__vfptr[1] myData[theIndex] = {entity=0x000001b317e85940 <Information not available, no symbols loaded for TKG2d.dll> }

2 replies

How to get maximum encumbrance of a solid revolution

Hi all, I want to get the maximum encumbrance of a solid in revolution around an axis. The solid may have an arbitrary shape and I have to get the outer contour of the shape generated by the revolution of the initial solid around an axis. Have any one an idea of how can i do this ?

3 replies

Get history of a changed shape

Hello, I am using the following code snippet to fix small faces of a given shape. Handle(ShapeFix_FixSmallFace) sffsm = new ShapeFix_FixSmallFace(); sffsm->Init(shape); sffsm->SetPrecision(tolerance); sffsm->Perform(); TopoDS_Shape shapeGet = sffsm->FixShape(); After that, I want to get the modified

0 replies

Dot-dash line type TopoDS_Shape/Edge

Hello All, I am creating a dot-dash line type in the viewer by creating AIS_Line and then setting the appropriate line aspect for that. Is it possible to get the TopoDS_Edge/Shape in the dot-dash form from it? Or is it possible to create TopoDS_Edge/Shape of that type in the first place? Thanks & Re

1 reply1 file

points on ellipse

Hello all, I have an Ellipse (height 800, width 200) and try to find a) the point on the ellipse on a given height 60 b) the tangent at the point found (please see attached sketch) gp_Pnt center(0.0, 0.0, 0.0); gp_Dir dir = gp::DX(); gp_Ax2 axis(center, dir); gp_Elips ellipse_gp = gp_Elips (axis,800

2 replies1 file

How to use BRepAlgoAPI_Fuse efficiently?

Hi, I need to fuse 10 TopoDS_Solid which represent simple 3D boxes. I found this peace of code on the official OCC web site ( https://dev.opencascade.org/doc/overview/html/specification__boolean_ope... ): #include <TopoDS_Shape.hxx> #include <TopTools_ListOfShape.hxx> #include < BRepAlgoAPI_Fuse.hxx

0 replies

Boolean Cut Problems

Hello, When I use BRepAlgoAPI_Cut to cut tool(some cylinders),the result is not as what I wish, some cylinders seem cutted right, but others have errors: TopoDS_Shape shape = revol.Shape(); TopoDS_Shape tool = *rollers; BRepAlgoAPI_Cut brep_cut(shape, tool); I tried cut cylinder one by one, but the

0 replies3 files

How to add an internal TopoDS_Edge to TopoDS_Face?

Hi All, I would like to add an internal edge to face, as shown by the red line in the figure. I wish the face wasn't divided into two. Which interfaces should be used to implement this function? And what is the final topology structure?

1 reply1 file

I want to create bounding box in modeling using Bnd_Box Class.

I want to create a bounding box for a created shape box. Below is the basic code attached. void MakeBox() { BRepPrimAPI_MakeBox abox(1, 1, 1); TopoDS_Solid aShape = abox.Solid(); Bnd_Box box; BRepBndLib::Add(aShape, box); Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; box.Get(aXmin, aYmin,

4 replies

Generate Sweep of non-planar surface from rotation matrices and translation vectors

I need to be able to approximate the swept volume generated by sweeping a 2d-surface (possibly non-planar) in 3d-space. The sweep can be parametrized by a 3x3 rotation matrix R(t) depending on a parameter t (we can think of it as time) and a translation vector also depending on t. In the documentati

0 replies

How to put AIS_InteractiveObject to a Bnd_Box?

I want to put multiple AISInteractiveObjects to a mutual Bnd_Box and then get coordinates of the center of this Bnd_Box . I noticed that BRepBndLib::Add gets TopoDS_Shape, but nothing about ais interactive, so how to either put AISInteractiveObject or get a TopoDS_Shape from AISInteractiveObject? Or

1 reply

Simple sphere cut from cylinder fails

This code produces invalid shape. Input shapes are both valid of course. auto shape1 = BRepPrimAPI_MakeSphere(gp_Pnt(1, 1, 1), 1).Shape(); auto shape2 = BRepPrimAPI_MakeCylinder(1, 1).Shape(); auto op = BRepAlgoAPI_Cut(shape2, shape1); op.Build(); auto shape3 = op.Shape(); BRepAlgoAPI_Check analyzer

1 reply

Mesh inside of flat face - is it possible? [SOLVED]

Dear OCC Community, I am currently exploring meshing using OCC and I'd like to know if I reached a dead end. I am familiar with how tesselation works for OCC when you want to create an STL, for example. However, is it possible to force the mesher to place Nodes inside using one of the OCC's algorith

8 replies2 files

Unsorted Edges => Wires

Hi Friends, Interesting case I didn't managed to figure out. The attached file is a very simple Wire. It is composed of 8 Edges, with 2 of them overlapping. I want to get, somehow, the 2 closed manifold sub-wires and discard the overlapping (ie. 2 disconnected wires with 4 edges each). What I've tri

0 replies1 file

BRepAlgoAPI_Splitter with closed wire

Hi I am using the BRepAlgoAPI_Splitter to split a shell with a closed wire. I need as a second step to choose the faces which are inside the wire. Currently at a loss on how to detect this; attached is a step file with the result of an example splitting and the wire used. Thanks.

15 replies2 files

Conversion to BSpline surface

GeomConvert::SurfaceToBSplineSurface fails for a surface of linear extrusion because it's unbounded/infinite in the V direction. I tried to use the adaptor's UTrim and VTrim interfaces but got the same error (i.e. inifinite surface). Is there another way to do this? Thank you.

0 replies

How to mesh each face from igs model?

I imported an igs model. Then I want to discretize each of its faces into a grid. I try to use "TopExp_Explorer","TopTools_MapOfShape". Then what I need to do?

0 replies

Shape is broken by BRepAlgoAPI_Cut

Hello, I want to get a model that eliminates shape2 from shape1. However, the following program will break the shape. Is there any good solution? [code] BRepAlgoAPI_Cut cut( shape1, shape2 ); cut.Build(); shape3 = cut.Shape(); [Environment] Opencascade: V7.5.3 OS: Windows 10 Pro 64bit CPU: Intel(R)

6 replies4 files

How to get UV from edge of planar

When I get the UV values on the plane, there are only max and min values. But I want to get all the values on the face, is this possible? when I use BRepTools::UVBounds on the plane. Why is the UV value on the plane not 0 to 1, but a specific value? How can I cut the trapezoid to get the plane norma

0 replies1 file

360 degrees face offset

Hi! I’m trying to offset a face 360 degrees . I tried different approaches but none of them worked properly, so I got stuck and I don't know how to continue. I'm going to explain to you what I want to achieve and what I tried until now, hoping that maybe you can offer me some suggestions or guidance

5 replies12 files

How to transform a TopoDS_Wire to a BSpline curve?

Hi Bros, I'm JianBaoxia. I get a .step file, it consist of several TopoDS_Edge. I try to build the edges into a wire, and then try to express the wire as a BSpline curve. First I try to sort the edges through the "ShapeAnalysis_WireOrder", however, the status is -1, means "some edges are reversed, b

0 replies1 file

Degenerated edges removing will change the shape

Currently, I do not have much idea about what is the meaning of "Degenerated edges". If someone could explain this, that would be very helpful. I tried to find detail about that but could not get clear idea. Also, I saw there are "Degenerated shapes", "Degenerated vertex" and "Degenerated curves". B

2 replies1 file

How to delete step file after importing it

Hello: I want to delete the step file after importing it. The Step file is imported by STEPCAFControl_Reader. Then the reader transfer into (TDocStd_Document) doc. The doc is inited by XCAFApp_Application. After everything is done. The doc is closed by XCAFApp_Application::Close(doc). But I still ca

0 replies

position of a AIS_Manipulator

Hello all! How to get the position - relative to the attached object - from a AIS_Manipulator? Handle(TopLoc_Datum3D) locManipulator = m_manipulator->LocalTransformationGeom(); qDebug() << "locManipulator" << locManipulator->Transformation().TranslationPart().X()<< locManipulator->Transformation().T

1 reply

How to eliminate the gaps in the discretized model?

I read a IGES file by IGESControl_Reader and used BRepMesh_IncrementalMesh to discrete it, but it creates some gaps. Now I want to know how to close these gaps, does opencasde have any libraries that can handle it? the BottleCap.IGS is the model file. and the picture in attachments is the problem I

3 replies2 files

BRepOffset_MakeOffset API gives inaccurate result

I am offsetting conical body using BRepOffset_MakeOffset API and getting inner and outer edges of the base and top of cone are not in line with each other. BRepOffset_MakeOffset offsetShape = new BRepOffset_MakeOffset(solid, thickness, Precision.Confusion(), OCC.BRepOffset.BRepOffset_Mode.BRepOffset

1 reply2 files

Triangulate TopoDS_Shape with Netgen and OpenCascade

Hello Forum! I have an existing project which successfully uses the OpenCascade 7.5.0 library. But when I tried to use OpenCascade to triangulate different TopoDS_Shape from .STEP files I have figured out that OpenCascade triangulation is not good for solvers algorithms so I have decided to include

2 replies

How does OCC realize the intersection calculation of spraying?

Is there any way in OCC can achieve the effect of spraying: for example, solving the intersection of a surface and a solid, and being able to assign thickness to it? It feels like the common Boolean operations RepAlgoAPI_Section, BRepAlgoAPI_Common, BRepAlgoAPI_Cut, and BRepAlgoAPI_Fuse don't quite

0 replies

Measuring the angle between a flat surface and a cylindrical surface

Hello Everybody, I need to measure the angle between a flat surface and a cylindrical surface with opencascade. For example for holes. When i try to use Angle_dimension, all times return 0. Maybe someone know how to do this. Thank you in advance

0 replies

Self sewing shells

Hi, I am trying to create a loop (a bit like a thin ring) from a BSpline Surface where two of the edges are co-incident. Is there a way to create either: - a surface that is infinite in one direction (i.e. around the ring) - or a shell where the edges have been sewn together? See the uploaded image

1 reply1 file

Method to deal with free bounds(edges)

The question is: When I translate stp file to igs format, the intersection between planar face and curved face becomes disconnected. There are free bounds appear using ShapeAnalysis_FreeBounds to detect them. But I didn't find functions to heal these free bounds. Is there any solution can do this in

2 replies2 files

GCPnts_UniformAbscissa issue

I have a B-Spline 3d curve , built from an array of 3d points calling a function like this: Handle(Geom_BSplineCurve) aBSplineCurve = aBSpline.Curve(); where aBSpline comes from GeomAPI_PointsToBSpline . This is ok. Now I want get discrete 3d points on that curve, using "GCPnts_UniformAbscissa" clas

4 replies

Deleting mesh triangles and computing a mesh/plane intersection

Hi, I want to load a STL file and then want to work on the mesh deleting triangles if need be. What are the classes dedicated to such a task? In a second time, I need to intersect this mesh with a plane, is there an operation to do it on the mesh directly? Or should I convert the mesh into a TopoDS_

1 reply

Finiding shared egdes for 2D planar shapes

I have a couple a of planar 2D geometries which share some edges. What's a good way to find the common edges? Upon googling I found an old post ( https://dev.opencascade.org/content/finding-common-edges-two-surfaces ) which works with contiguous edges (but this may not be the case with me). Also, so

3 replies

How to rotate around a pivot

Hi, I don't understand how to make multiple transformations at once and get the result. I'm not sure if it is a problem with the order in which it should happen. The gp_Trsf seems to make one transformation at a time and therefor I think multiple gp_Trsf must be chained to get the result. My use cas

0 replies4 files

How to compute the intersections of 3D curves.

Dear everyone: I now work on a mesh generation application with open Cascade. However, the constraints, including the vertex, curves and surfaces have to be standardized or checked before the the grid tessellation. That means, the intersections of these constraints have to be obtained. I have check

5 replies

right number of edges

Ciao let consider the step file in the attached picture: the number of edges is 19. A TopoDS_Shape is readed and loaded with a standard step reader (.oneShape()): this is "aShape" in the following TopTools_IndexedMapOfShape allEdges; TopExp::MapShapes(aShape,TopAbs_EDGE,allEdges); cout<<"____total n

8 replies4 files

Smoothening a stepped edge

Is there a way to smoothen a staircase like edge in a 2D geometry? In general please point me to some smoothing example.

0 replies

BRepAlgoAPI_BuilderAlgo vs. BRepAlgoAPI_Fuse

I have below questions about them: 1. Is there a way to supply a list of shapes to BRepAlgoAPI_Fuse as one can do for BRepAlgoAPI_BuilderAlgo? If yes, please provide sample code. 2. Can we also set parallel run and glue options for BRepAlgoAPI_Fuse as shown below for BRepAlgoAPI_BuilderAlgo: BRepAlg

3 replies

Fusing millions of cubiodal voxels

What's an efficient way to fuse millions of voxels together. 1. Voxels are all cubiodal. 2. Voxels may share boundaries but they never intersect.

5 replies

Issues during BRepAlgoAPI_BuilderAlgo::Build and SimplifyResult

I am getting the following warnings during BRepAlgoAPI_BuilderAlgo::Build: 1. BOPAlgo_AlertBadPositioning 2. BOPAlgo_AlertNotSplittableEdge What are the possible reasons for the above? Additionally, the SimplifyResult step isn't merging all the faces together. What could be the problem there? Below

0 replies

Fuse is not merging shapes' faces

I would like to merge two cuboids such that their common faces also get merged. Currently, I am not able to get those common faces merged with the below code: [code] const TopoDS_Shape b1 = BRepPrimAPI_MakeBox(10, 10, 20); const TopoDS_Shape b2 = BRepPrimAPI_MakeBox(gp_Pnt(5, 0, 0), 30, 30, 30); con

5 replies2 files

Point Cloud TopoDS_Shape Distance Calculation

Hi, I have a body and an aligned point cloud. I need to color every points. I used BRepExtrema_DistShapeShape class but distance calculation of 225k points took lots of time. Is there any other option to calculate? Thank you. Code: Handle(Graphic3d_ArrayOfPoints) points = aisPC->GetPoints(); Handle(

2 replies

How to create TopoDS_Shape from MeshVS_DataSource?

How to create TopoDS_Shape class from MeshVS_DataSource class? class TopoDS_Shape I will use to get properties (SurfaceProperties, VolumeProperties and etc)? Or other question: How to get properties from MeshVS_DataSource?

0 replies

BRepPrimAPI_MakeTorus does not return a torus

Here is the code to reproduce the issue: #include <iostream> #include <gp_Ax2.hxx> #include <TopoDS_Shape.hxx> #include <BRepPrimAPI_MakeTorus.hxx> #include <StlAPI_Writer.hxx> #include <BRepMesh_IncrementalMesh.hxx> void Generate_Shape(TopoDS_Shape * store) { gp_Ax2 axis = gp_Ax2(gp_Pnt(0,0,0), gp_

5 replies2 files

BRepPrimAPI_MakePrism return Compound Shape

Hello. I want to get the shape as one solid of the shell stretched. When I tried following code, the result shape was compound shape. How to get shape as one solid? [shell] Archived image: 003-shell.png [shape] Archived image: 004-shape.png [code] shape = BRepPrimAPI_MakePrism( shell, gp_Vec( srX, 0

0 replies4 files