DiscussionsIssue archiveVisualization and 3D Viewer

Forum archive

Visualization and 3D Viewer

Technical discussions preserved from the public OCCT community forum.

Topics
627
Replies
1,764
Files
507

Discussions

Page 4 of 11

Showing 60 discussions, ordered by the latest archived activity.

Using OpenCascade with Dear Imgui and GLFW

I am expanding a GLFW example with some code to work with Dear ImGui. My main subroutine looks like this: void GlfwOcctView::run() { initWindow (800, 600, "glfw occt"); initViewer(); initDemoScene(); if (myView.IsNull()) { return; } myView->MustBeResized(); myOcctWindow->Map(); initUI(); mainloop();

9 replies1 file

Hatching Clip Plane For Meshes

Dear developers, I'm trying to use a clipplane on an AIS_Shape built from an stl-file. The clipplane's hatching(/Capping) works fine for .brep but shows a hollow cross-section for .stl. The way I am building it is (note that I'm using the pythonocc-wrapper of OpenCascade): from OCC.Core.Graphic3d im

2 replies2 files

How to repeat texture on faces?

Hello, I've been working with textures in OCCT and came across an issue where, after calling the EnableRepeat function to enable loop sampling mode for textures, I still find that the UV parameters of the texture mapping are confined between 0 and 1. This limitation results in the texture being stre

2 replies

Missing Pbr textures in GI render scene

Enable path tracking: aPrarms.IsGlobalIlluminationEnabled = true; aPrarms.Method = Graphic3d_RenderingMode::Graphic3d_RM_RAYTRACING; When rendering 30 models with pbr materials and BaseColorTexture present, the textures set later will be lost

8 replies15 files

Project to 2D

I'd like to project a part to 2D using hidden line removal with HLRAlgo_Projector , but the projection is off and I can't figure out why. I've disabled the perspective transformation and the coordinate system is perfectly top down and it still looks like it's being projected with a perspective. Here

8 replies2 files

Displaying assembly and change its color

I am reading STEP assembly using STEPCAFControl_Reader and putting all the compounds and solids in a tree structure. My tree node contains a name which I obtained from TDF_Label , and a shape which is AIS_ConnectedInteractive . I display this tree by recursively going thru all the nodes and using m_

1 reply

how to Use Smooth Lighting to the AIS_Triangulation?

I am using the following code to build a triangulation: Handle(AIS_Triangulation) m_hTriObject = new AIS_Triangulation(poly); m_hAisContext->Display(m_hTriObject, Standard_True); m_hTriObject->Attributes()->ShadingAspect()->Aspect()->SetInteriorStyle(Aspect_IS_SOLID); m_hAisContext->SetDisplayMode(m

1 reply

how to call "GetNodeNormal" instead of "GetNormal" in my own MeshVS_DataSource?

surface = new mySurface(str); surface->Triangulation(true); Handle(myDataSource) aDS = new myDataSource(surface->CoordData,surface->NormalData,surface->Ele2NodeData); this->AddMesh(aDS); for (auto m : m_meshvses) { Handle(MeshVS_Mesh) mesh = Handle(MeshVS_Mesh)::DownCast(m); m_hAisContext->Display(m

1 reply

Crop line under a TextLabel

Hello community. I wonder if there's any way to crop an AIS_Line that is drawn "under" an AIS_TextLabel. I create measure lines and would like to crop the line when the label is in front of it independently to the current view zoom. You can see in the snapshot my implementation on the left and what

2 replies1 file

Is it possible to have native support wayland?

Hi, I found that OCC application can't work on wayland, that's because you can't get the window handle from winId(). https://bugreports.qt.io/plugins/servlet/mobile#issue/QTBUG-76983 Although, I can simply set export QT_QPA_PLATFORM=xcb to make it work, but that isn't the final solution. I found the

0 replies

Missing Qt-Platform-Plugin "wayland" - pySide / pyQt / visualization

Hey together, I'm getting started with pythonOCC for my thesis and I'm already struggeling at the installation-part :D but motivation is high. So: I managed to install pythonOCC (7.7.0) inside a venv with python 3.9 via Anaconda (took me longer than I want to admit...) on my Ubuntu 22.04 machine. An

2 replies1 file

AIS_Trihedron selection

I want to know that which component of the AIS_Trihedron is picked. (Origin / X axis / Y axis / XY plane / XZ plane / YZ plane)

3 replies

How to generate the desired wire

When I cut the figure, I just want to get the outermost cut outline of the remaining figure, but I never know the right way to do it. BRepAlgoAPI_Section section(tube,ParentBox,Standard_True); section.ComputePCurveOn1(Standard_True); section.Approximation(Standard_True); section.Build(); OuterWiredr

1 reply1 file

why text set cullingsize is not work

i use AIS_Shape and AIS_TextLab set cullingsize.when Mousewheel,the ais_shape won't be rendered,but the text will.there is any way make text affect. Handle(AIS_InteractiveContext)thcontext=...; Handle(V3d_Viewer) theViwer=...; Graphic3d_ZLayerSetting aSetting=theViwer->ZLayerSetting(Graphic3d_ZLayer

3 replies3 files

Add profile lines to objects ?

Hello here. Is it possible in any way to display profile lines of shapes, especially curved shapes like cylinders / spheres ... ? See the screenshot in attachement to see what I want to achieve. Thank you very much.

2 replies2 files

Rendering 100s of text causes memory overhead.

Hi, I added few thousands of text object with different height. When text height goes beyond 100 the application consume huge amount of memory. I tried to set scale of the AIS label by setting SetLocalTranformation and reduce the height. But scaling doest have any impact on the text size. Is there a

5 replies1 file

How to draw the outer outline of AIS Shape

Hello, I want to know how to draw the outer outline of AIS_Shape when AIS_Shape has holes 111.png is the effect I want to achieve. If it is a complete TopoDS_Wire, what I use is to traverse all faces, and then judge whether the normal direction of this face is parallel to the Y-axis. If it is parall

0 replies2 files

Transparency of Lines

Hello everyone, I would like to ask if Opencascade’s customized AIS supports setting the transparency of lines? Thanks.

2 replies

How to select shape from viewer?

Hello, everyone! I have a question now. I want to select edge or face, then save the attribute of them. But when I use the code below, selectedShape is Null. TopoDS_Shape selectedShape = m_context->SelectedShape(); TopAbs_ShapeEnum objectType = selectedShape.ShapeType(); if (objectType == TopAbs_VER

1 reply

Mouse focus on AIS_Shape or selected AIS_Shape, the shape display different color

I new myHilightDrawer and myDynHilight Drawer as selected Drawer and focus Drawer. But after selected the shape, the normal Drawer is not hide. How to hide normal Drawer when selected status? WireFrameDraw::WireFrameDraw(TopoDS_Shape const& shape) : AIS_Shape(shape) { { myHilightDrawer = new Prs3d_D

1 reply4 files

Visualization HLR and Material

Hello, I'm trying to use the Visualization HLR as described in this tcl example( https://draw.sview.ru/visualization-hlr/ ). It works properly if there is no material setted on the AIS_Shape, setting properly the AIS_InteractiveContext's Default Drawer Shading Attributes: ais_context_->DefaultDrawer

2 replies

HLR and AIS_ConnectedInteractive

Hello, in my project, I am using AIS_ConnectedInteractive class to have multiple instances of the same TopoDS_Shape appropriately translated and scaled. Everything works fine except for the HLR representation. When I request this type of representation, the ComputeHLR method, which performs the fina

4 replies1 file

Selection Mode TopAbs_FACE & TopAbs_EDGE Together

Hello OCCT Community, I've used "Selection Mode" with my AIS_InteractiveContext and when I assign "TopAbs_FACE" to the SelectionMode method (it can be seen below code block and the image of TopAbs_FACE), I am able to acquire the faces of my mesh object: ais_interactive_context_->Display (XCAF_Prs_AI

4 replies2 files

Selected Edge remains in the viewer

Hello All, I am selecting an edge on a part and moving the part along the direction of the edge. When I do so, the selected edge remains in the viewer. How can I delete/remove it from the viewer? I have attached screenshots. Thanks & Regards, Author

2 replies2 files

Transparency of AIS_Trihedron object

Hello everyone, I use OpenCascade 7.6 for my c# project and I don't know why can't change the transparency of AIS_Trihedron object. I've tried both methods and nothing's changed. So is there any other opinion to do that? _gnomon->SetTransparency(_transparency); _context->SetTransparency(_gnomon, _tr

1 reply

VIS CAD model interaction

Hello, I encountered a problem when using VIS that the ShapeId(IVtk_IdType) I obtained when selecting with the mouse was incorrect. Causing the obtained ShapeIdList(IVtk_ShapeIdList) to be empty. I don't know how to solve this problem. Do you have any good suggestions.

3 replies4 files

Highlighting a selection of a STEP file by name

I am trying to determine the best way to highlight a section of the model programmatically using the name. I can iterate through the shapes and read the names of the nodes. So I can determine at match on the label but I cannot figure out how to highlight said label. When I find the match, I have tri

0 replies

Unable to select to model surface at the mouse point position

Hello, We encountered a problem while developing the OCCT program that we're unable to select the step model surface at mouse point position.Sometimes we did not select the surface where the mouse point was located, but the back of the step model. 1. Here's the codes to import step model; void OCCFe

4 replies3 files

Show .step error

I get a different result when i use CAD_Assiatant and SoildWorks,and when i Convert this .step to .glb it's still like this,Is it a Bug?

1 reply

Fill inside of shape after cut operation

Hello everyone, I import a stl file which likes a big cylinder and want to open hole inside of that shape. I have figured it out how to cut but I have problem from this point. Cut shape looks like empty and looks bad actually (like attached photo). And maybe there are some methods to fill inside of

1 reply1 file

2D drawing of cross section

Hi, we're currently checking if OpenCascade could be used as a replacement of our own graphic and mesh generation framework. So, as of now, I'm reading through the examples and checking the documentation. And a question spring to mind: If I have created a 3D representation of my structure, is there

3 replies

Link InteractiveObject to user data structure

Hello, I'd need to have some sort of link from an AIS_InteractiveObject (for example, after selecting on screen) and an underlying data I store elsewhere. It would be enough to have an user integer field usable as an array index, but I see no one.... Just the Owner field, which is a transient pointe

5 replies

Highlight without Select the object

Hello, I want to make a dynamic selection, where the user see the shapes highlighted when hovering them with the cursor, and after clicking on them they will be selected and shown highlighted (as in 3d CAD software). Currently to highlight an object or parts of it, I open a localContext and set the

7 replies1 file

OCCT + GTK4 not working

I tried to replicate this sample: https://github.com/gkv311/occt-samples-gtk/ While the original (which used GTK+-3.0) didn't start due to an old version of GTK+-3.0 being installed, my own implementation (using GTK4) did. However, I can't see anything on the blank GtkGlArea window, and I get: TKOpe

13 replies

normal to mesh elements

Hello forum using Tetgen I generated from a watertight surface mesh a volume mesh. Since I want a second order mesh I add, to each first order tetrahedron, the midside nodes, simply by calculating the midpoint of each mesh segment. Since I would like to have "curved", isoparametric elements I projec

3 replies3 files

Please help CADRAYS

My problem is I am opening CADRays, I am importing a STEP file and I am trying to add texture on it but CADRays doesn't shows my textures. I tried different images but no one works. Can somebody help? Why CADRays not showing textures?

0 replies

Seam lines in closed surfaces

I am currently working on a project that involves tesselating shapes using the BRepMesh_IncrementalMesh class in Open CASCADE Technology, and storing the vertix and index buffers for visualiation. However, I have encountered an issue specifically related to closed surfaces, such as spheres, where th

1 reply1 file

Render fewer shapes while zoom or rotate for a large model

I want to use OCCT to develop a CAD for architecture, the buidling is large, so there are lots of shapes. As other architecture modeling software, when there model is large, it will hide some shapes of the building while zoom or rotate. I also want to do this with OCCT, but not find the way yet. For

2 replies

"Default FBO wrapper creation failed" Error

Dear Community, We show Open CASCADE scene and OpenGL scene in different pages and dialog windows of our application. I'm having trouble with one, but not every dialog window, and it only happens on the windows side (it works fine on the Linux side). Error messages I get: TKOpenGl.WinSystem | Type:

0 replies1 file

How to get geometric data of selection?

Hello. I have managed to dispatch when selection occurs. I have have also managed to iterate of objects of class AIS_InteractiveObject . My final step would be obtaining geometric parameters of my selection - for example - coordinates of points. Here is my code: void GlfwOcctView::OnSelectionChanged

8 replies

Color of Compound

Hello everyone, Firstly I import step file and I read all labels. But when label is solid, I can get the color of label but if label is compound then could not get the color. Why this is not working on compound? For any help I will be appreciated. TDF_Label referred_label{ label }; Handle_XCAFPrs_AI

1 reply

Locate an AIS_Trihedron at the origin that given with gp_Pnt

Dear OCCT Community, I have added a sphere to a vertex I have chosen in the scene and I am trying to locate an AIS_Trihedron at the origin of this sphere. The direction information is correct, but its position is far from where I set it and it is drawn. I've added the image about this issue and I am

6 replies1 file

Crash when calling FitAll(true) on Viewer

Hello. I have solved an issue, but decided that project maintainers may be interested to know about it. I have followed example, managed to read STEP file and get its contents, in form of TopTools_HSequenceOfShape object. Now, I am displaying it in my 3D view(er)/AIS_InteractiveContext. and doing Fi

0 replies

OCCT+VTK interaction problem

Hi there, I got a problem with interaction shapes rendered in VTK. i have followed guides ( https://old.opencascade.com/doc/occt-7.5.0/overview/html/occt_user_guide... ) step by step. But when I use 'Pick' function. It seems picked nothing. Here are my parts of codes. Build info: VTK 9.1 QT 6 OpenCA

1 reply

dynamic highlight second order elements

hello forum, the elements (face or volume) of a first order mesh are efficiently highlighted when detected: see Fig.01: the mouse position is indicated by the black arrow. When the mesh is converted into a second order one, by adding midside nodes (and redefining each mesh element), the highlight me

1 reply4 files

Boolean operation with triangulation

Hello everyone, I use opencascade for my c# project and because of that I have a OCCTProxy like occt sample project. I want to open holes on stl file. Firstly I import a stl file and create a cylinder which will be a hole on stl file. While cutting the my stl file, I got an error about System.Access

0 replies

Dynamically highlighting elements of a Graphic3d_ArrayOfPrimitives

Hello! I have an array of Graphic3d_ArrayOfPrimitives which displays a chain of chained lines and tessellated arcs. I like to dynamically change the color and thickness of a line (two consecutive vertices) or an arc (a series of consecutive vertices) from the array when I move a slider control. How

0 replies

Set transperency for AIS_Line

Hello Everyone, I am trying to change transperency of AIS_Line using SetTransperency() , but it does not seem to work. Handle_AIS_Line line = new AIS_Line(aPnt1, aPnt2); Handle_Prs3d_Drawer myDrawer = new Prs3d_Drawer(); Handle_Prs3d_LineAspect asp = new Prs3d_LineAspect(Quantity_NOC_BLACK, Aspect_T

2 replies

customizing highlighter

Hello forum, I have a MeshVS_Mesh object, that I displayed using a certain presentation builder occHandle(MeshVS_MeshPrsBuilder) aBuilder = new MeshVS_MeshPrsBuilder(aMesh, MeshVS_DMF_OCCMask, aMesh->GetDataSource()); customized through its drawer aBuilder->GetDrawer()->SetDouble(MeshVS_DA_EdgeWidth

1 reply2 files

Highlighting an array of colored segments

Hello! I have an array of Graphic3d_ArrayOfPrimitives which contains segments colored with different colors. When highlighting it (using HilightSelected() and HilightOwnerWithColor()), I want to modify only the segment width of each element inside the array, but the colors to remain the same. Which

4 replies

OpenVR read from devices

Hello all, this code will start and display the viewport on my HTC Vive: void OccView::cameraStereoVR() { Aspect_OpenVRSession* openVR = new Aspect_OpenVRSession(); m_view->View()->SetXRSession(openVR); m_view->View()->XRSession()->SetUnitFactor(1000); m_view->View()->XRSession()->SetTrackingOrigin(

3 replies

AIS_ColorScale font bug ??

Not sure if this is a bug, but sometimes, when adding an AIS_ColorScale object, it looks like the text is double printed, not sure what is happening there Anybody any experiences with this?

1 reply1 file

OpenVR occtvr_actions.json not found

Hi all, When trying to run OpenVR is get following error: OpenVR, Unable to open actions manifest 'C:\Users\XXX\Documents\QtProjects\windows\build-GabbieCam-Desktop_Qt_5_15_2_MinGW_64_bit-Debug\GabbieCam\debug\GabbieCam.exe/occtvr_actions.json' I copied all the json-files from ...\opencascade-7.7.0\

2 replies

Avoid gradient color on a segments array

Hello! I have a Graphic3d_ArrayOfPrimitives array created using indexes, and I like to indicate a specific color per segment , not per vertex. What is the recommended solution? If I cycle using myPArray->SetVertexColor() the segments are colored in gradient like in the picture attached, which is not

4 replies1 file

AIS_TextLabel can not display

//draw point BRepBuilderAPI_MakeVertex ver(gp_Pnt(0,0,10)); TopoDS_Shape topo_shape = ver.Vertex(); Handle(AIS_Shape) pt_ais = new AIS_Shape(topo_shape); mwin->myContext->Display(pt_ais,true); //draw text Handle(AIS_TextLabel) text_label = new AIS_TextLabel(); std::string text_ = "0.06"; TCollection

6 replies