Hello, i have read the source code of vuserdraw command in ViewerTest_OpenGlCommands.cxx. I want to draw something using the Render() function, which means i need to create a OpenGl_Workspace as the parameter of the Render() function. So i create a OpenGl_Workspace using a WNT_Window which is create
Hello forum, I've two questions: 1) is it possible to exploit the highlight mechanism in order to highlight not an entire shape, but a subshape of a main shape (for example, a face of a cube), I mean programmatically 2) if yes, would it be possible to customize the highlight such that also in wirefr
My STEP reader fails in reader.ReadFile() function (STEPCAFControl_Reader reader OC7.4). How can I output diagnostic information during the read phase to diagnose the failure? I want to find the line or entity that is causing the failure. The file is very large > 5GB. Thanks.
Hello everyone, I don't know if you use OCAF framework. During use, I am full of confusion , can you please help me explain by referring to the attached picture? Attachment picture 1 is the result of viewing the XmlOcaf file through DFBrowser . Attachment picture 2 is a code snippet of me. 1)Attachm
I have an AIS_InteractiveContext where I display some shapes as follows: Handle(AIS_ColoredShape) displayedShape = new AIS_ColoredShape(transform.Shape()); displayedShape->SetHilightAttributes(faceStaticHighlightAttributes); displayedShape->SetDynamicHilightAttributes(faceDynamicHighlightAttributes)
Hi, I try cut a box with a strict smaller inner box but it seems that BRepAlgoAPI_Cut doesn't give the real cutted solid. auto box1 = BRepPrimAPI_MakeBox(gp_Pnt(0,0,0), gp_Pnt(3, 3, 3)); auto box2 = BRepPrimAPI_MakeBox(gp_Pnt(1,1,1), gp_Pnt(2, 2, 2)); auto cut = BRepAlgoAPI_Cut(box1, box2); std::vec
I have a test file that runs fine when loaded with "source test" in DRAWEXE, but fails in a weird ay with -f oprion form command line. I'd appreciate someone to confirm the problem or help me to solve it. $ cat test pload MODELING VISUALIZATION vertex A 0 0 0 vertex B 0 0 25 vertex C 0 0 0 vertex D
Hi everybody, I'm quite new with occt, i'm sorry if my question if quite obvious. I want to consolidate a list of solids (here 5 boxes) up to get a "clean" geometry to mesh. I found an old post and i try this piece of code which work pretty fine : TopTools_ListOfShape shapes; shapes.Append(BRepPrimA
Hello. I am trying to get common part of two shapes by following codes, but it is not working. The shape type of common part is "TopAbs_COMPOUND", but it does not include face. I use OpenCascade version 7.4.0. ----------------------- code -----------------------> TopoDS_Shape shape1; BRep_Builder bb
Hi, I am using OpenCASCADE to export data in STEP format. In my software, TexGen, a series of points around a yarn are stored, shown in the StepExport file (it's using a low resolution for debugging purposes). The yarn is converted as shown in the code snippets below. The points in the SectionPoints
I'm trying to solve this problem [1]. In order to do it I want to create script for DRAWEXE to replicate the issue. I understand the basics, but I can't figure out how to make edge from 2 vertices. I tried mkedge, wire, line, but nothing seems to provide function to create edge from 2 vertices. Is t
Hello I have a problem with constructions of bspline curves. Here is my code to design a bspline curve. This code rans very well and I can display it, but the bspline curve passes throught all of the control points (poles).Is this wrong or not? The answer of my second question is probably basic, but
I don't know if you have done such an effect? (Reference picture projectq & a.png) 1 is a closed curve 5 is a curved surface Now I want to project 1 onto 5 and divide 5 into two parts . I used the following code to achieve the effect in the figure. 2 is the curve of 1 projected onto the surface of 5
I need to import constraint by programmable method. It is good the solution is script language or compile language. It will be also good it is even command line interface.
Hello, I create a triangulation of the sample file CrankArm.brep. Then I traverse the faces and edges as follows: TopTools_IndexedMapOfShape faceMap; TopExp::MapShapes(myShape, TopAbs_FACE, faceMap); for(int j = 1; j <= faceMap.Extent(); ++j) { const TopoDS_Face& face = TopoDS::Face(faceMap(j)); Top
Hello, I'm using AIS_TextLabel to show a 3D located and rotated 'decal' on the surface of another object. I would like to be able to position it based on the centre of the first letter, for example. In order to do this, I need some way to measure the bounds of a label, before displaying it. I've exp
hi. now i face a problem. i want to project one shape to another face of other shape. but i can't know projection direction. so are there any way of getting direction between two shapes????
i use class BRepExtrema_DistShapeShape for getting the minimum distance between two shape. then i see "solution" in this class. As far as I understand, there are many ways for getting a minimum distance. Is a way for getting a minimum distance the solution ?? what is "solution" of this class??
Hi, I am trying to change my selection colour I have found examples to turn on edge drawing via SetFaceboundaryDraw(true)..., and this was working as expected in OCC7.0.0, but I have now upgraded to 7.4.0 and the edge color is not being set, but width is. Similarly I have tried setting a SelectionSt
Hi im thinking about using OpenCascade for a virtual reality solution to overlay 3d data in a real environment. To do this I must be able to set up the OpenCascade camera to match a real camera (Pinhole camera model) A real camera has the following parameters: 3d position / 3d orientation Field of V
Hello everyone, I don't know if you have encountered such a situation before. Through myView-> Dump (aFileName.ToCString (), Graphic3d_BufferType :: Graphic3d_BT_RGBA); the color of a picture is different from the color in the rendering scene. The two pictures in the attachment are from the dump and
Hello everyone, when I used Graphic3d_ShaderProgram of occt 7.4.0 , I wrote XRay.vs and XRay.fs two coloring fragments. Add the shader to the selected model through the first code below, but in myAISContext-> CurrentViewer ()-> Update (); when the program crashes , but if you remove the three PushVa
I want to use 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 all.
Hello everyone, when I use the fillet corner function of occt 7.4.0, the program crashes. I tried to debug the source code and found that the problem is here: Convert Handle (Adaptor2d_HCurve2d) to Handle (BRepAdaptor_HCurve2d) cash in occt 7.4.0 . The debugging results are shown in Figure 1 2 3 . T
Hi everybody, attached is a STEP file of a volume geometry. If I open it with SolidWorks, everything looks fine. OC instead thinks the geometry is empty (0 volumes, 0 surfaces). Is this a bug in OC? Thanks! Author
Hi, I am trying to load a STEP file (exported from SolidWorks) in OpenCascade 7.4.0. and I ran into a crash. I can't share the model itself at this moment, but I will put in a request to share the part that causes the issue. In the meantime I was hoping this might sound familiar to some people, or t
I Construct a loft pipe with BRepOffsetAPI_ThruSections, but get a distorted result, as displayed in the picture. the sections are Geom_Curve object from somewhere in my project. It looks like the Geom_Curve should be modifyed in some way to get nice result, but how to do it? the code is as below st
Hello, I have a problem applying TopoDS_Wire ShapeAnalysis::OuterWire(const TopoDS_Face & face) on a surface derived with BOPAlgo_Splitter() . The problem is that half of the edges of the resulting outer wire are from the original face (before applying the splitter), and half of the edges are from t
Hello, I am a novice in OCC. Probably, it is a simple question. I made a point with void GLWidget::getPoint(QList<double> (pointList)) { pointGList = pointList; for (int i=0; i<pointGList.count()-2; i=i+3) { gp_Pnt point (pointGList.at(i),pointGList.at(i+1),pointGList.at(i+2)); TopoDS_Vertex V1 = BR
I want to change the color of the face which is selected, the face belongs to a object in the context . And I think the function "AIS_ColoredShape::SetCustomColor" can solve this problem.However , When I use it in my Qt project ,it crashed . Here is my poor C++ code .I will appreciate if any help. i
Hello, I use OpenCascade V7.4.0 for windows 32bit. I want to know the maximum and minimum X, Y, Z coordinates of the model, I tried to find the coordinates using BRepBndLib as below source. [MyCode] Bnd_Box bb; BRepBndLib::Add( shape, bb ); bb.SetGap( 0.0 ); gp_Pnt pntMin = bb.CornerMin(); gp_Pnt pn
I want to use a BRepOffsetAPI_MakePipeShell to make a threading of a screw. but it not work as I expect. Please help me. My code : TopoDS_Shape MyPipe(const TopoDS_Wire &wbase, const TopoDS_Wire &along, const double k) { /// Calculate the length of the path //---------------------------------- GProp
Hi, I'm trying to decompose a b-spline to a set of circle definitions. If you're working; yes I'm trying to generate G-Code ;) Since a number of CNC / CAM apps are based on OCC I'm wondering whether you might be able to point me in the right direction. Thanks, -jelle
Running GCPnts_UniformAbscissa on a wire doesnt generate point on some edges.I tried running GCPnts_UniformAbscissa on that specific edge and IsDone method returns false. What are some common problems that I can troubleshoot.
Hello, I use the following code to read and display a stl mesh. Which works fine. However, I cannot figure out how to select a node with the mouse. How can I activate the node selection mode in order to do that? I hope someone can help, as I am new to OCCT. Thanks a lot in advance! OSD_Path aFile(fi
Hello, after upgrading from OCCT 7.3.0 to OCCT 7.4.0 the manually triggered highlighting of an AIS_InteractiveObject does not work as before. The following code snipped shows, how I trigger the highlighting manually. AIS_InteractiveContext aContext; AIS_InteractiveObject aObj; ... // manual highligh
Hello everyone, I don't know how to set the value for sampler2d in the fragment shader of shaderprogram of occt7.4.0? gooch.fs precision highp float; varying vec2 TexCoords; varying vec3 WorldPos; varying vec3 Normal; // material parameters uniform sampler2D albedoMap; uniform sampler2D normalMap; u
Hello, I'm using BRepBuilderAPI_Sewing and BRepBuilderAPI_MakeSolid to create solids out of a polygon mesh. My code works perfectly, thank you for that great product. The prototype I'm working on is part of scientific work, so it would be great if I can get some information about the algorithms behi
Hi, I'm tried to obtain the colors associated with every shape from a IGES file. but the result seems wrong, all the colors for different shape are same. code ==================================================== Handle (XCAFDoc_ShapeTool) l_Assembly = XCAFDoc_DocumentTool::ShapeTool (Doc->Main()); T
can I display the opengl primitives (gl_line, gl_triangle, etc) in opencascade based application. currently, all elements are displayed as follows: ---------- myAISContext.Display(...); ---------- So, how can I display the triangles using the opengl way, like: ---------- gl_begin(gl_triangles); ...
Although I am not developing with OpenCascade, I am writing a small IGES exporter for one of my own programs. I am using US Pro IGES 5.3 specification and the IGES output from FreeCAD (and various other programs) as a guide to finding my way around this neutral file format. However, I have run into
Hello all, I am trying to draw an arrow. To do this I am currently using an AIS_Trihedron, and only drawing the Z axis. The arrow is drawn which is great, but I would like to hide "Z" axis label text. Is there a way to do this? Or is there a better way to draw an arrow? Thanks!
I've been tasked with adding functionality to move a hole in realtime, I imagine with the manipulator or otherwise. Theoretically, how would this be achieved, if even possible? Currently, I'm envisioning some sort of use of BRepBuilderAPI_MakeFace(Wire), which would have to be recalled on each movem
I'm creating a polygon using BRepBuilderAPI_MakePolygon, then using BRepPrimAPI_MakePrism to extrude the polygon to become a 3D shape. However, the resulting shape isn't being closed. E.g. if I create the polygon using coordinates in the X-Y plane, then extrude in the Z direction using BRepPrimAPI_M
Hi. I want to convert the position of mouse to the coordinate in 3D. I used the following. view->Convert(mx, my, x, y, z); But, there may be much deviation. Could you tell me the way to convert it correctly?
Hi, I am using OpenCascade since Version 6.8 and currently 7.0. Now I am facing some problems when updating to 7.3 The problem is the usage of a UserView as recommended in the Upgrade notes to OpenCascade Version 7.0 for an own OpenGL-Drawing class UserView : public OpenGl_View void UserView :: rend
I used IGESControl_Reader to import igs file into occ, and use the GiveList(“iges-faces”) to read all face, but the model have been imported contains the reference plane, and the surface have not been trimmed? thus the same problem occurs in the sample of import/export while importing the igs file.
Hi, All, I want to use the tag of a label to access this label in the OCAF tree. But I am not sure the tag is unique or not. Can anyone help me? Thanks in advance! Chris
Hello, When I change the position of AIS_InteractiveObjects with Ais_InteractiveContext->SetLocation() I get the object hilighted in the original position. I create some object in this way : ... pObject=new AIS_Shape( ); ... myAISContext->Display(pObject,Standard_False); myAISContext->ResetLocation(
I want to use CGAL and openCASCADE at the same time but when I compile the project error C4430: missing type specifier - int assumed. Note: C++ does not support default-int I think this is because: openCASCADE define the macro: # define Handle(ClassName) Handle_##ClassName while CGAL define a class
Hi all, By the way thanks "Angel" for the helpful tip the last time. The problem, I'm currently on is to display a Geom_BSplineSurface as an interactive object. As the AIS_InteractiveContext->Display() only takes AIS_Shape objects, and the constructor for AIS_Shape objects needs a TopoDS object, it
Hi EveryBody, I use the following code to find the intersection curve between a surface (MySurface) and a Plane (MyPlane). Most of the generated curves (aCurve1) exactly lie down on MySurface, but many of them are wrong that a part of these wrong curves are straight lines and dont lie down on MySurf
I'd like to annoance a free project hosted at: https://sourceforge.net/projects/cadplatform/ The whole project uses OCCT technology including OCAF. It supports parametric modeling, smart object snaping and a rich set of geometry modeling tools, it's convinient for modeling. It also support mesh oper
Hi, I am using OCCT660 to convert an IGES format to OpenSceneGraph Format. I am having troubles calculating normals for each triangle. here is the code that I am using to calculate normals of triangle. Handle (Poly_Triangulation) triangulation = BRep_Tool::Triangulation(face, location); if (!triangu