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 1 of 11

Showing 60 discussions, ordered by the latest archived activity.

Helper lines/Flyout lines cutomize

Using PrsDim_LengthDimension is there a way to customize only the helper/flyout lines? What I want to achieve is this: From the center of the object the helper line should be dotted. The arrow line with the calculated distance should be solid.

0 replies

How to proper render into PixMap?

The `V3d_View` class has a `ToPixMap` method that renders the view into the specified image buffer. But is it possible to use this function without attaching any `Aspect_Window` to the view? I just created a new `V3d_View`, set up its camera, and called `ToPixMap`. It fails inside the function becau

1 reply

Setting custom SelectMgr_BaseIntersector for Selection.

I want to select objects with some tolerance value in world coordinates. Currently OCC support pixel based tolerance value using SelectMgr_SelectingVolumeManager::SetPixelTolerance(). But its works based on zoom value. Is there any way to set own SelectMgr_BaseIntersector object to SelectMgr_Selecti

1 reply

OCCT with Avalonia UI

Avalonia UI is Free & open source UI framework for stunning, performant cross-platform apps with .NET. OCCT-Avalonia project make OCCT View as UserControl in Avalonia Window, and it is MIT License. https://github.com/BIMCoderLiang/OCCT-Avalonia All suggestions are welcome~

0 replies1 file

texture/material limitation for ray- and pathtracing

Hi there, I'm working on a 3D-Viewer for loading OBJ-files with the OpenCascade-rendering-technology. It works perfectly, but now I run into a possible limitation regarding materials/textures. In the Graphic3d_RM_RASTERIZATION-mode I can load any OBJ-file with hundrets of different materials with te

2 replies4 files

General transformation for PrsMgr_PresentableObject

PrsMgr_PresentableObject transformation defined by TopLoc_Datum3D, which is essentially just a gp_Trsf. gp_Trsf supports only uniform scales. Such limitations are understandable for shapes, but for meshes, they impose a serious limitation on rendering certain real 3D models. For sure, transformation

6 replies3 files

Best approach for rendering 10,000+ identical objects (Instancing)?

Rendering 10,000+ identical objects generates a massive number of draw calls. While using AIS_ConnectedInteractive avoids re-submitting rendering data, it does not reduce the number of draw calls. Is there a way to achieve an effect similar to native OpenGL's glDrawArraysInstanced? Specifically, can

2 replies

mat3 or mat4 uniform

Is there any way to set mat3 or mat4 uniform into my custom fragment shader? Graphic3d_ShaderProgram::PushVariable supports only a limited set of types :(

3 replies

V3d_viewer on Android

Hello all, I try to build an app in android to visualize a step file and I am using something like that myViewer = new V3d_Viewer(aGlDriver); The error what give me AS is: No matching constructor for initialization of 'V3d_Viewer' candidate constructor (the implicit default constructor) not viable:

0 replies

Render into ImGui viewport

I am trying to render V3d_View into an ImGui viewport: m_FBO = Handle(OpenGl_FrameBuffer)::DownCast(myView->View()->FBOCreate(theWidth, theHeight)); m_FBO->ColorTexture()->Sampler()->Parameters()->SetFilter(Graphic3d_TOTF_BILINEAR); myView->View()->SetFBO(m_FBO); It successfully renders the view int

4 replies2 files

Render IMGUI controls on top of GlfwOcctView from Samples

The base code is taken from the OCCT Samples and I want to add the IMGUI controls on top of it. I get some weird behaviour(continuous flickering) as you can see here: Archived image: external image . I tried setting: graphicDriver->SetBuffersNoSwap(true); , but the result generated displays only the

3 replies5 files

How to improve interactive performance for large STL meshes in OCCT 7.5?

I am currently using Open CASCADE Technology (OCCT) 7.5 to load a large STL model of approximately 1.9 GB. After reading the file and displaying it using AIS_Shape, I experience severe performance issues during basic interactions such as model rotation, translation, and bounding box updates. The vie

3 replies

Can't set Line width using V3d_View with QOpenGLWidget

Hello, I have migrate my Qt/OCC integration from V3d_View/QWidget to V3d_View/QOpenGLWidget like done in the OcctQtViewer sample application https://github.com/gkv311/occt-samples-qopenglwidget but now the linewidth of wireframe shape is not working anymore (see difference in attached image, left is

6 replies2 files

Render into a QQuikItem

Hello, Anybody any pointers on how to render into a QQuickItem? So far I am able to render into a qquickitem by using a QQuickFramebufferObject derived class and creating a renderer. This works but always renders in the complete window instead of only the QQuickItem contents. I tried with deriving m

8 replies5 files

Questions about AIS_ViewController dragging behaviour

Hello, My team and I are currently working on a modeling software. We are using AIS_ViewController and are encountering some issues in achieving the desired behavior. We would like to have the following behavior: 1) The user clicks on an object, and a gizmo appears. 2) The user clicks and holds on t

0 replies

Multi-touch Gesture Handling for Zooming with AIS_MouseGesture_Zoom on 3D View

Hello OCCT Community, I would like to handle on our Qt project with multi touch screens. I've tried that CAD Assistant application works very well with multi-touch screens and I've investigated some multi-touch methods on OCCT side. However, I couldn't overcome multi-touch problems on our project. I

5 replies

Abnormal display of faces

Hello everyone, I’ve encountered an issue as shown in the attachment. For the same Shape, when hovering the mouse to highlight or clicking to highlight different Faces, one of the faces displays abnormally, looking like it’s broken. Could anyone please advise on a solution to this problem?Thank you

2 replies2 files

How to calculate interpolation in animation

In the previous version (Open Cascade 7.7), I derived a class from AIS_Animation and overrode the Update method. Within this method, I retrieved the interpolated transformation values using gp_TrsfNLerp myTrsfLerp. However, in Open Cascade 7.9, this variable has been made private, so it is no longer

0 replies

Set highlight style on a GLB object is not changing the highlight

I am using this code in the initviewer function to try to load the model and set the highlight style. // Create AIS context myContext = new AIS_InteractiveContext (myViewer); myContext->SetDisplayMode ((int )AIS_DisplayMode::AIS_Shaded, false); myContext->DefaultDrawer ()->SetFaceBoundaryDraw(true);

4 replies2 files

Rotation to assembly

While reading a STEP file, I’ve created a tree data structure representing assemblies and parts. An assembly can contain sub-assemblies and parts. A part is always the last node in the hierarchy. For assemblies, I save the label using: auto shape = XCAFDoc_ShapeTool::GetShape(assmLabel).Located(loc,

1 reply

Custom shader for selection

Hello here. I'm trying to write a custom shader to display selected faces of drawn shapes through the drawer retrieved by myInteractiveContext->HighlightStyle(Prs3d_TypeOfHighlight_LocalSelected). I want to draw some kind of hatch pattern on selected faces through a shader program. I'd like to draw

6 replies2 files

Zoom in and display problem

i use occt 7.7 ,the whole program create in .NET CLR in the using progress,i find when i zoom the object to the max scale,the display effect will deteriorate. the example is such as the figure 11 and 12 i can use which method to control this display behavior ,i expect your help ,think you very much

7 replies6 files

The rotation values are not being retrieved correctly

I have loaded a STEP file into the viewer and selected the AIS_InteractiveObject representing a part. For that part, I attached an AIS_Manipulator to enable interactive rotation. I enabled the rotation axis using: AIS_ManipulatorMode::AIS_MM_Rotation To perform rotation, I selected the axis and drag

1 reply

Invalidate AIS_PointCloud elements

Hello! I have an AIS_PointCloud data and try to hide some of its elements by re-uploading modified portion of Graphic3d_ArrayOfPrimitives without recomputing entire presentation using Graphic3d_Buffer::InvalidatedRange() mechanism. I indicate below the code used for this: // define the points array

4 replies

Dynamic visibility control for a fixed-size point array in OpenCascade

Hi everyone, Is there a way to work with a mutable array of graphic points in OpenCascade? I have a fixed-size set of points - potentially several megabytes of point data!- that need to be shown or hidden dynamically at runtime. Ideally, I’m looking for something similar to a mutable Graphic3d_Array

0 replies

Display custom subClass of AIS_InteractiveObject cause program collapse

I write a sample program, custom a subclass of AIS_InteractiveObject, and display. when i run this code in a pc with GPU Intel770, it is ok, but when i run in a pc with GPU intel 770 and nvidiat1000, it collapse, and i get info : "An exception occurred at 0x00007FFD09C711B2 (TKV3d.dll) in ...exe: 0x

2 replies

Display custom subClass of AIS_InteractiveObject cause program collapse

i write a sample program, custom a subclass of AIS_InteractiveObject, and display. when i run this code in a pc with GPU Intel770, it is ok, but when i run in a pc with GPU intel 770 and nvidiat1000, it collapse, and i get info : "An exception occurred at 0x00007FFD09C711B2 (TKV3d.dll) in ...exe: 0x

1 reply

How to Get a 3D Point on a Visible Face and Project it to 2D Screen Coordinates

Hello, I’m working with a 3D model in Open CASCADE that includes a rim consisting of three layered parts. These parts are stacked such that the first part visually covers the second when viewed from the front. In my use case: - I have selected the second part, which is correctly highlighted in yello

2 replies1 file

Issue with Multi-selection object transformation

Hello everyone, I'm facing an issue with selecting and translating multiple parts in my application built using OpenCascade. Here's the scenario: Condition 1 I first select Part_A, then select Part_B. Now both parts appear selected. When I apply a translation along any axis, only one part moves, the

2 replies

On-the-Fly Graphic3d_ArrayOfPrimitives for Streaming Geometry

Hello! I’m currently receiving controlled-size chunks of vertex data over time and accumulating them into a final vertex array/vector. Each packet may contain between 1 and 1 million vertices. Once I received the final packet of data, I build a Graphic3d_ArrayOfPrimitives with Graphic3d_TOPA_SEGMENT

2 replies

Set the boundary to pan with in the limit

I am using OpenCascade for drawing lines. I can pan inside the view to indefinite coordinates. Right now my requirement is to set a limit for panning inside the drawing area. Example: To set a limit of +- 200. Above this coordinates limit the application should stop panning. Could any one please hel

0 replies

Texture map image resources are occupied and cannot be deleted

The SetTextureFileName() method in class AIS_TextureShape sets texture maps. After rendering, then the source image is occupied and cannot be deleted, in version 7.8.1 the same method in version 7.7.0 ,I can do it, Why? Have any modifications been made here? I hope someone can help me.

5 replies

Setting Trihedron to Selected Shape's Origin Point (Location)

Dear OCCT Community, I have added a sphere to a vertex I have chosen in the scene and I am trying to locate a 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

1 reply3 files

MeshVS_ElementalColorPrsBuilder, MeshVS_Mesh::computeSelection()

Hello forum, I generated and visualized a volume mesh of a solid, made of first order tetrahedra. I'm able to dynamically select and highlight the volume elements using an elemental color presentation builder (MeshVS_ElementalColorPrsBuilder) and issuing AISContext->Activate(meshIO,MeshVS_SMF_Volume

3 replies3 files

TopoDS_Compound Highlighting

Hi all. For drawing performance issues i made TopoDS_Compound object from thousands of lines and arcs, smth like that: BRep_Builder builder; TopoDS_Compound compound; builder.MakeCompound(compound); ... adding in cycle line->topoShape = BRepBuilderAPI_MakeEdge(line->startPoint, line->endPoint).Edge(

2 replies

ImmediateMode usage

Hopefully a pretty simple one... How do you use AIS_InteractiveContext ImmediateMode drawing? I guessed it was something like this: _context->BeginImmediateDraw(); for(//something) { Handle(AIS_InteractiveObject) a = //object _context->ImmediateAdd(a); } _context->EndImmediateDraw(); _context->Redra

1 reply

Obtaining absolute transformation from AIS_Shape

I have an AIS_Shape which has been loaded from file, then had SetLocalTransformation() applied to it (rotation + scaling). It display fine... I now want to process vertices from this shape, using TopExp_Explorer - but just walking the underlying TopoDS_Shape gives me the pre-local-transformation rot

1 reply

AIS_Manipulator unresponsive (7.9)

could have sworn this worked before upgrading to 7.9.0... I've got a problem with AIS_Manipulator::HasActiveMode() never returning true... Implementing AIS_Manipulator as: void Ccanvas::showManipulator(CCutShape *selection) { if (m_Manipulator->IsAttached()) m_Manipulator->Detach(); AIS_Manipulator:

8 replies

unbinding mouse buttons

I'm trying to unbind the left-hand mouse button, but can't seem to get it to un-function! From my AIS_ViewController descendant class... myMouseGestureMap.Clear(); myMouseGestureMap.UnBind(Aspect_VKeyMouse_LeftButton); myMouseGestureMap.UnBind(Aspect_VKeyMouse_RightButton); myMouseGestureMap.Bind(As

2 replies

V3d_SpotLight setDirection doesn't work

Handle(Graphic3d_CLight) m_light = new V3d_SpotLight(gp_Pnt(0.0, 0.0, 5000.0), V3d_XposYneg, Quantity_NOC_WHITE); m_AISLightSource = new AIS_LightSource(m_light); doesn't matter what I do, the spotlight always points down (z-). Also when I change with setDirection(gp_Dir(...)); the m_AISLightSource

8 replies7 files

Embed the widget can't fill the parent widget

I have such a requirement, I need to build the software in linux with qt, and embed OCCT in the middle of the software. Currently, the embedding can be completed, but there is a problem, when I render the embedded OCCT, the occt control cannot fill the display, as shown in the following figure,The s

0 replies2 files

AIS_Animation is acting weird.

Hi, I am using AIS_Animation to make an animation, but I got a weird result. I am new to opencascade, I am not sure if there is something wrong with my code. Here is my code: TopoDS_Shape part = BRepPrimAPI_MakeBox(50.0, 50.0, 50.0).Shape(); gp_Trsf tsf; tsf.SetTranslation(gp_Vec(80.0, 180.0, 0.0));

1 reply1 file

Export AIS_Animation to video file

Hello everyone, I am creating animations in a MFC based application using opencascade. Is there any way to export it to a video file like MP4 ? Thanks, Author

4 replies1 file

Getting error wglMakeCurrent() has failed

Hello, I have a 3D application using OCC/V3d_View base on Qt 5.15... The application run fine... but I have notice this error recently when I left my computer on with the application running all night, when I come back the next morning I got this error: TKOpenGl.WinSystem | Type: Error | ID: 6 | Sev

15 replies4 files

how to delete a PrsDim_LengthDimension

Hello all, how to delete a PrsDim_LengthDimension? void OccBase::clearDimensions() { qDebug() << "dimensions before cleaning" << m_dimensions.size(); Handle(PrsDim_LengthDimension) dim; for (int i=0; i<m_dimensions.size(); i++) { dim = m_dimensions.at(i); OccViewManager::instance()->myContext()->Era

2 replies

Display Mode 2

Hello all when I set the displaymode=2 on an ais_shape I get a dotted line around the dimensions of TopoDS_Shape. when I increase the dimensions of the TopoDS_Shape the dotted outline is updated correct - so far, so good. but if I make a dimension of the TopoDS_Shape smaller, for example the length,

7 replies1 file

A question about clipplane

When I tried to use AISnManigator to control the clip plane, I encountered some issues: I feel like I used the wrong transformation of the plane, and when I use the manipulator to control it, I don't feel like it met my expectations; When I try to drag the plane for translation, the manipulator disa

0 replies

Trouble with Vertex selection in big shapes

Hi! I am drawing huge shapes by loading measures with a lot of vertices (over 5 million). Given the amount of vertices, instead of generating a face for every triangle, I am using a function like this one: //Build face/shape from triangulation const Handle(Poly_Triangulation) aTris = new Poly_Triang

1 reply

wireframe view of AIS_Shape; set color

Hello, AIS_InteractiveContext::SetDisplayMode(AIS_WireFrame,true/); shifts the current view of a set of AIS_Shape(s) to wireframe mode. From pic00.png to pic01.png. Here each wireframe of each shape is displayed with the color of the shape. I would like to display the wireframe of each shape in a ce

2 replies4 files

Looking for a solution to add 3D model viewer to CADBase platform website

Hello there, I'm looking for a solution to add 3D model viewer to CADBase platform website. Ideally, the viewer should support glTF format and engineer-oriented functionality (dimensions/distances, etc. as in https://github.com/fougue/mayo/blob/develop/doc/screencast_1.gif). One of the nuances is th

0 replies

Graphic adjustment when resizing a 3D Viewer

Hello everybody, as the window hosting my OCC application can be resized, I've noticed that the zoom factor is adjusted in some way (sometimes) when the user changes the window sizes. More in detail, I've seen that when the X size is modified, the zoom level tends to stay the same as long as the sce

8 replies8 files

how to get correct shape location

hello , I met a problem when trying to get the Z locaion of a plane by selection. I am using OCCT 7.7 on ubuntu 22.04. I made a window to show the step file, and selected a face on the body. I want to get the Z location of the face but got two different result which really makes me confused. // this

2 replies

How to Set Different Colors for Local Highlight Elements

Content: I am working with OCCT in C# and trying to set different colors for edges and faces when using SetHighlightStyle(LocalDynamic). Below is the Prs3d_Drawer setup I am using: var drawer = new Prs3d_Drawer(); drawer.SetZLayer(-2); drawer.SetupOwnDefaults(); drawer.SetDisplayMode(1); drawer.SetC

4 replies4 files

Graphic3d_PBRMaterial SetBSDF hangs with 7.9.0 [resolved]

This was working with 7.7.0 and now I get an error with 7.9.0: Graphic3d_PBRMaterial pbrMaterial; pbrMaterial.SetEmission(Graphic3d_Vec3(0,0,0)); Graphic3d_BSDF bsdfGlass = Graphic3d_BSDF::CreateGlass(Graphic3d_Vec3(0,0,0), Graphic3d_Vec3(0,0,0), 0.5,0.5); /*hangs now here -> */ pbrMaterial.SetBSDF(

3 replies