I am trying to create some bindings for a programming language named Nim . I am struggling to show a bare minimum example in terms of visualization. I tried to follow the tutorial: occt - minimal viewer setup . Maybe it is not good example, because that is for windows and I am in Linux, but I didn't
Hi, We are building a product with Visualisation that relies on line rendering with variable widths. Recently, we changed the windowing framework for our Viewport. Everything worked as expected, except lines are now only 1px thick everywhere, despite changing the Prs3d_LineAspect width. After some i
Hi gentlemen, I have an exception in the OpenGl_Window constructor during render from another background thread. The exception comes from wglShareLists(…) that return false and set GetLastError() to 170 (The requested resource is in use). The main UI thread of my app use OCC to display geometry to u
Hello, I want to create and display a shape that will not be affected by zoom function of v3d_view. Do you have any ideas to achieve that? For instance if I create 2 shapes, after zooming in or out I want to zoom whole view and one of the shapes will stay in the same size at view. (By the same size
I want to change selection highlight style to use thicker line. I tried: Handle(Prs3d_Drawer) localSelectionStyle = myDocument3d->getContext()->SelectionStyle(); Handle(Prs3d_LineAspect) aspect = new Prs3d_LineAspect(Quantity_NOC_BLACK, Aspect_TOL_DOT, 5); localSelectionStyle->SetLineAspect(aspect);
Hello, Is it possible to select/detect a point in an AIS_PointCloud? I added an AIS_PointCloud and opened a local context with selection mode TopAbs_VERTEX m_hAISContext->CloseAllContexts(); m_hAISContext->OpenLocalContext(); m_hAISContext->ActivateStandardMode(TopAbs_VERTEX); If I hoover over the p
Hi, let's start with an example: I want to start interactive circle selection: AIS_InteractiveContext->Activate(AIS_Shape::SelectionMode(TopAbs_Edge)); Handle(StdSelect_EdgeFilter) Filter = new StdSelect_EdgeFilter(StdSelect_Circle) AIS_InteractiveContext->AddFilter(Filter) but when hovering over th
Hello, I am trying to implement the showing and hiding of both shapes and faces. I've got one problem, where after the user hides a shape, then decides to show a face, the face after that will not able to be selected for hiding. Hiding and showing faces and shapes each have their own mode. I pass at
Hello Sir's, Hope you are in great spirits! I am actually trying to add my custom textures to the panels of my buggy, which is in obj format converted through Solidworks Visualize. But due to some constraints I am unable to detect the steps to follow for adding my custom textures to my model, I am u
I created an AIS_Triangulation from Poly_Triangulation and colored it as shown here: https://dev.opencascade.org/content/how-use-opengl-directly-occ%EF%BC%9F . However, doing AIS context->Display is not showing anything. Please say what could be the problem.
Hello forum, I used Netgen for meshing a TopoDS_Shape. The resulting mesh is good enough for a FEM calculation. Now I would like to store the surface mesh into the shape, fully replacing the stl mesh generated by the BRepMesh_IncrementalMesh for visualization purposes (shaded view). These are the st
Hey, I'm currently working on a viewer for 3D models as part of a larger project. I decided to use OpenCASCADE for visualization, however I'm quite new to the ecosystem. I would like to know how I can render custom OpenGL on top of a 3D viewer. I've managed to build a basic viewer based on OpenGL an
I have recently upgraded from OCC 7.4.0 to 7.6.0. In the upgrade I have noticed that the text (X, Y, Z) on the Trihedron is missing. I have tried using the "simple" TriedronDisplay function as well as manually defining a V3d_Trihedron. The code I am using is below. Is this a bug? Or is there some fu
Hi All, I am developing a custom 3d viewer. I would like display 3d shaded objects about like Cad-Assistant does ( see attached picture) can someone show me how to achieve this? Thanks
Hello, I have a strange problem in a specific step file which seems to have no problems in it’s format. Essentially, I can correctly select the entire model as a compound shape, and the highlight will apply from my custom attributes. However, when I select faces individually with the face selection
I am using OpenCASCADE for visualization. I want to switch views just like switching layers, showing different models. How to use one V3d_Viewer for multiple AIS_interactivecontexts to achieve this?
hi everyone. i use the PrsDim_LengthDimension to make dimension,the text is turn when i rotate the camera. but when i select the Dimension and rotate the camera,the hightlight part do not turn,only the origin part will turn,just look like two text overlap. how can i deal with this. best wishes.
hi, oc 6.9.1: i have problem with missing highlighting of objects under cursor during the selection. mouse clicking works, and selection is accepted correctly. apparently this behaviour is connected to update to win11... do you have any idea how to fix this problem? thanks, Author
Dear users and developers, I am trying to resize shapes in only one direction. Up till now I've used gp_GTrsf on TopoDS_Shape to obtain this goal succesfully (e.g. for scaling in the x-direction I use a matrix gp_Mat(scalingFactor,0,0,0,1,0,0,0,1) together with gp_GTrsf). I've switched to transforma
I have been playing around with Ambient, Diffuse, Specular and Emissive color... Whatever I set up I just can not have pure Black color. Why I get Blue color If I set everything to 0.0? Same If I turn all lights off. Same If I have Graphic3d_MATERIAL_ASPECT Handle(myDataSource) aDS = new myDataSourc
The AIS context lets one select a 3D object by SelectDetected() function. Is there a way to detect surfaces of a 3D object instead of the whole object?
I would like use this in a user control with .NET. However, the CSharp examples are using MDI forms. When I zoom all as a user control, the result seems off-center. Please see if I am missing something. Following is the description of the attached files: C++ CLR DLL: 1. OcctClrClsDotNetFrameworkLib.
I'm trying to create a Graphic3d_AspectMarker3d and Graphic3d_ShaderProgram s to display various markers from an atlas instead of using the predefined markers or providing and switching custom Graphic3d_MarkerImage . Everything is working fine except that i cannot find a way to make the value set wi
Dear OCCT Community, I have trouble in changing the color of the coordinate system near the viewcube. At the sametime, due to already having a coordinate system when initializing my view, erasing the coordinate system near the cube maybe also a good choice. Could you please help me with problems abo
Hi, Can anybody tell me how to get the X Y Z points(gp_Pnt) when i click some where on the screen. I understand we get only two values from the screen. can we identify the plane in which we are clicking. I see the code of taking xMin and yMin in the "OnLButtonDown" function. but i need the "Z" value
I'm trying to create a vbo containing integer types and a shader for it but i'm only getting garbage values for the integers. As soon as i'm switching to floats everything works as expected. I checked every Graphic3d_ShaderAttribute in the Graphic3d_ShaderAttributeList list and the shader code but e
Dear All, I would like change the edge color of viewcube , programmatically I compiled this code, but it doesn't work ( in the sense the edges are always diplayed black) : opencascade::handle<AIS_ViewCube> aisViewCube = new AIS_ViewCube; aisViewCube->SetBoxColor(Quantity_NOC_WHITE); const Handle(Prs
Hi All, I am using XCAFPrs_AISObject to store main shape (the box shape) and use TDocStd_Document to store shape labels; both main shape and sub shapes. Here I saved main shape label and add faces as child as sub shapes. Now I want to hide face from the view which is a sub shape. But I could not fin
Hello , I am playing around AIS_VIEWCUBE code sample. I have created a sample application and CubeView is displayed at left/Bottom screen. I woul like display it at top/Right I have used this code: aisViewCube->SetTransformPersistence( new Graphic3d_TransformPers(Graphic3d_TransformPers(Graphic3d_TM
I'm porting some old V6.5 code to 7.x and stumbled over the use of Graphic3d_Group::Polygon with the Graphic3d_TOP_CONVEX flag for which i cannot find a direct replacement. Debugging the 7.x version where i'm trying to use Graphic3d_ArrayOfPolygons showed that now GL_POLYGON is used which doesn't su
I'm trying to create a visualisation of a STL mesh where it's possible to continuously update the node colors. I found MeshVS_Mesh and the MeshVS_NodalColorPrsBuilder where a color map can be specified as a Aspect_SequenceOfColor but i think this doesn't allow for continuous update of the node color
Hello, let me briefly describe my scenario: - OCCT 7.4.0 - I have path tracing turned on: Graphic3d_RenderingParams& aParams = myActiveView->ChangeRenderingParams(); aParams.Method = Graphic3d_RM_RAYTRACING; aParams.IsGlobalIlluminationEnabled = Standard_True; - I have light source: V3d_PositionalLi
Hi, I am wondering as to the correct way to solve this particular issue: Two shapes which should be intersecting appear to have a gap between them when zoomed in closely, however when zoomed out, one shape can be seen protruding through the other. The amount of protrusion varies with the relative ca
I am using the V3d_View::SetProj to change view orientation but i dont't know how to use AIS_ViewCube to do it.Should i use this method? aViewCube->HandleClick (aDetectedOwner);
Hello forum, a quick question about mesh selection and highlight styles. Please, have a look to the attached picture: The surface mesh of a model is shown in wireframe mode. When clicking a triangle is selected and shown using a "shrink" view, in gray When moving the mouse each detected triangle is
Hello, I am working on an industrial machining new simulation project and checking various solutions at this stage. In this simulator, meshes are first-class citizens (solids are meshified). My company has been using OCCT for decades. To implement a graphics engine + renderer in OCCT, I extended the
Hello, I activated mode c=7 (TopAbs_VERTEX) for an AIS_Shape which I displayed onto my viewer. It was simply a cube. I would like to get all the owners of TopAbs_VERTEX shapes occContext->Activate(c); occHandle(SelectMgr_IndexedMapOfOwner) m; occContext->EntityOwners(m,curAIS,c); cout<<"____"<<m->Ex
Hello, Now I'm trying to add a fully transparency object. I made a Prs3d_Drawer to disable all drawing features. But there remain wires (or face boundary?) like the screen shot. How can I disable all wire drawing of an object? Please help me ! P.S. SetTransparency(1.0) is not working for me. It show
Hello all, in this document (page 4) https://dev.opencascade.org/sites/default/files/documents/release_notes_7.5.0.pdf it says there is now Normal map texture support. Could please somebody be so kind and lead me to an example? All I was able to find was in opencascade-7.6.0\src\BinMXCAFDoc\BinMXCAF
Dear OCCT, Hello. I have a question about the sRGB color. Actually, the latest OCCT uses the sRGB color profile. But the color converting seems to be a little weird. For example, here is a sample RGB (19, 25, 31). I converted the values by using the Convert_LinearRGB_To_sRGB function like this. doub
Hello all, I am creating objects and assign textures like this: QFileInfo textureFilename(validPathToTextureFile); if (textureFilename.exists()) { TCollection_AsciiString aFile(textureFilename.absoluteFilePath().toStdString().c_str()); m_aisDisplay->SetTextureFileName(aFile); m_aisDisplay->SetTextur
Hello all, any idea how to get rid of the error "Error: texture can not be loaded (predefined texture Graphic3d_Texture2D_2d_MatraDatavision.rgb)"? searched everywhere for the file Graphic3d_Texture2D_2d_MatraDatavision.rgb but no luck thanks!
I have read a step file,and then i wanted to display the dimension. A error occured when i was constructing PrsDim_DiameterDimension ... //Get the dimension from the dimension label. //Handle(XCAFDoc_Dimension) Target if(Target->GetObject()->GetPath().IsNull()) { ConsoleLog("Is Null"); } //Display t
void MainWindow::mousePressEvent(QMouseEvent *e) { qDebug() << occtContext->NbSelected(); } qDebug() will only show NbSelected() for one selection before the last one. It seems to have a delay. Does anyone know, what might it be ? Thanks in advance, Author
Hi everyone, I am trying to get a 3D viewer (subclassed from AIS_ViewController ) to work with VR support. So far, the device is connected and detected correctly through OpenVR. The image appears in the device stereoscopically at the correct IOD. However, only orientation tracking appears to work. N
Hi everybody! I like to modify on the fly my AIS_Animation object play speed. The animation is started by StartTimer() method which also sets the initial play speed. In my app user interface I have implemented a Slider Control to increase and decrease the animation play speed. I do not know how and
Hello Nice Guys. Actually, Now I'm trying to add a 2d-Arrow for some direction. And I need to get the 2d-arrow always looking at the Camera. Such as one-axis billboard in 3D games. (For e.g. Tree Billboard in 3D game) Can I use the Graphic3d_TransformPers for this purpose? Or is there any other solu
Hi, I've learned some knowledge about OCC for some time. Now I can create shapes like cylinders and change their colors, but when I'm reading the source code of AIS_ViewCube I feel confused. I dont understand the usage of fields and methods in the code .I want to learn the process of creating custom
TopLoc_Location originalLocation = myAIS_TopoDSshape.Location() just returns null TopLoc_Location. Is there a reason or another way to get global position?
I made a selection owner inherited from SelectMgr_EntityOwner. In its HandleMouseClick() I would like to get the selected AIS_Shape. However, the selection owner returns only mySelectable which is a SelectMgr_SelectableObject, so how do I get the AIS_Shape?
So I have the following code. I just override the HandleMouseClick, the virtual function of SelectMgr_EntityOwner, to make my own. Standard_Boolean CustomizedOwner::HandleMouseClick(const Graphic3d_Vec2i & thePoint, Aspect_VKeyMouse theButton, Aspect_VKeyFlags theModifiers, bool theIsDoubleClick) {
Hello, I'm attempting to use the OpenVR support (using SteamVR and an Oculus Quest 2) in OCCT 7.6.1. I'm using AIS_ViewController and the code below to activate VR rendering: m_view->ChangeRenderingParams().StereoMode = Graphic3d_StereoMode_OpenVR; m_view->Camera()->SetProjectionType(Graphic3d_Camer
Hello OCCT Community, After reading the STEP file, I made an implementation to show each corner and center point when I click on any face on the resulting shapes. In some STEP files this works, in others it draws the vertex out of the shape. This problem can be seen in the images that I have attache
The SelectMgr_EntityOwner does not move with the translated object. so after you stop the mouse, you cannot select the object again. Also, after a while when you can select it, it start where the SelectMgr_EntityOwner originates. I looked at the SetLocation function and it does nothing. Do I have to
I have followed this example to bridge Opencascade and QOpenGLWidget. A small difference is that I made some changes to the OpenGl_FrameBuffer and used my own FBO (built around QOpenGLFrameBuffer). Because the purpose is to interop with native OpenGL stuff, the depth value is essential to mix differ
I'm using AIS_ColoredShape to display a compound shape containing many wires ("Z-slices" computed out of a shape). I use AIS_ColoredDrawer::SetHidden(bool) to dynamically show/hide some wires : const bool hiddenOn = ...; const TopoDS_Wire& wire = ...; Handle_AIS_ColoredDrawer aspects = m_aisShape->C