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

Showing 60 discussions, ordered by the latest archived activity.

Mesh of MeshVS_ET_Link (BEAMS) with colors - MeshVS_PrsBulder

Hello forum I would like to visualize a mesh made of beams, already created, in which each beam has its own color. Which among the available MeshVS_PrsBulder should I use? Nodal or elemental presentation builder? I have data by nodes, and by element, so for my application there is no difference Not

1 reply1 file

Not able to create instance for RWGltf_CafReader class

I am trying to create the instance of the "RWGLtf_CafReader" class, but it is giving the following issues RWGLtf_CafReader reader; (This line I am using to create the instance of "RWGLtf_CafReader" class). ISSUES: 1.:-1: error: CMakeFiles/temp.dir/main.cpp.o: warning: relocation against `_ZTV16RWGlt

5 replies1 file

Display Grid Co ordinates values

Hello, I am using Open cascade in Qt Qml for drawing lines. I have activated the grid and also I am able to do drawing. But I need to display the x y co ordinates values for the grid at the corner of the window as per the attached image. When I zoom in / out the co ordinates values should change bas

0 replies1 file

How to Display Coordinate System

Hello, I want to display coordinate system on the view as in attached photo(Only main axes X, Y, Z). Do you know how to do this? Thanks in advance,

3 replies3 files

[OCC & VIS] How to pick a face?

Hi, I followed the example in the tutorial, but it does not work correctly. What should I do? The following is part of my code: class CustomInteractiveStyle : public vtkInteractorStyleTrackballCamera{ ...... void OnLeftButtonDown() override{ vtkInteractorStyleTrackballCamera::OnLeftButtonDown(); pic

4 replies

7.5 => 7.8 broke text rendering in Qt application

[EDIT] The line width problem described here was because of OpenGL's core profile beiing set. It was a fix for the text not rendering properly, so now the problem is how to fix the text rendering in Qt (which is linked to the OCCT upgrade, probably because of the openGL dll) ? Since upgrading to 7.8

5 replies

BRepOffsetAPI_MakePipeShell problem

When I use BRepOffsetAPI_MakePipeShell build pipe,around the corner, have a blank.How to optimize this thing? Here's my code gp_Circ circle(gp_Ax2(p, vec.Normalized()), 2.0); Handle(Geom_Circle) geomCircle = new Geom_Circle(circle); BRepBuilderAPI_MakeEdge edgecircle(geomCircle); TopoDS_Wire circlew

0 replies1 file

ViewCube stops working when altering the selection method

Hi, The AIS_ViewCube works correctly, but when I change the selection method to for example edge selection, I clear all other selection methods, before setting the desired selection method Handle(AIS_InteractiveContext) hAISContext = GetAISContext(); if (hAISContext) { hAISContext->Deactivate(); hAI

2 replies

Control transparency when using metallic materials

Hello here. I have some problems using metallic materials in a PBR environment. I have a VisualMaterial with a PBR material defined like this: - use a texture file that contains transparent colors where alpha can be any value and opaque colors (see attached example, it has green fully opaque and red

2 replies2 files

Use AIS_Animation to create a rotation animation with angle greater than 180 degree

Hi everyone, I don’t know if you have any experience in creating animations using AIS_Animation . When I used AIS_Animation to create a rotation animation, I specified a starting rotation angle of 0 degrees and a stop rotation angle of 360 degrees to AIS_Shape. The animation time set was 10s. As a r

3 replies

Texture scale on faces

Hello community. I have a last problem for my OpenCascade 3D viewer. I have a shape (a rectangle) composed of two faces, one for the front face and one for the back face. I managed my shape like this because I have to draw different materials on the each face and need to be able to select independen

0 replies

let a shape translate first and then rotate it

Hello there, l already have a shape . And l want to let this shape translate first and then rotate . Show the whole process in the form of animation. l have already know need use AIS_AnimationObject class to creat a single animation and add them to AIS_Animation class. And now l can let the shape tr

2 replies1 file

HOW TO USE AIS_Animation WITH interactive?

TopoDS_Shape obj1 = BRepPrimAPI_MakeBox(100, 500, 20); Handle(AIS_Shape) ais_obj1 = new AIS_Shape(obj1); g_pDoc->myAISContext->Display(ais_obj1, true); gp_Trsf start_pnt, end_pnt; start_pnt.SetValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0); end_pnt.SetValues(1, 0, 0, 100, 0, 1, 0, 100, 0, 0, 1, 100); Ha

2 replies

How to apply and play animation ?

I want to apply animation to component. Animation consist of one translation motion and rotation around itself 360. I am able to apply translation and after that I am applying rotation. So animation looks like first object move from one point to another point then on second point it complete revolut

0 replies

Does anybody know how to change the rotation circle style of the AIS_Manipulator?

Dear developers: I inherit the AIS_Manipulator in my project, named MyManipulator. And I want to change the AIS_Shape style of the manipulator. For example, the rotation parts are quarter of a circle. Not a whole circle. I tried to inherit the AIS_Manipulator::Axis and edit source code of the AIS_Ma

0 replies

How to accelerate the the import function of STEP / IGES / STL

Hi all, I'm trying to import a huge CAD file in OpenCASCADE application (over 100 MB), and it takes to import and render on the screen. Are there any optimized parameters or methods in STEPControl_Reader / IGESControl_Reader / STLControl_Reader to make the process more faster?

1 reply

Problem with zoom limits

Hi, In my 3D scene i got a lot of shapes with a lot of details, so i want to zoom many many times to see those details. However the more i zoom, the less the zoom is strong till it not zoom at all, i guess it s due to a pourcentage factor on view. I would like to know if someone have an idea about h

0 replies

visualize an OCCT topological shape in VTK viewer

I want to visualize an OCCT topological shape in VTK viewer. I refer to the tutorial of VIS.However there throw exception in 'Mapper->SetInputConnection(DS->GetOutputPort());' Here is my code: // 1 . Create IVtkOCC_Shape instance(VIS wrapper for OCCT shape) and initialize it with TopoDS_Shape object

3 replies

Huge memory consumption with about 33 million AIS_Point shown

Hello guys, I have troubles with visualizing AIS_Point . I create about 0.33 million (330000) AIS_Point and use context->Load() to display them on screen, then I see a huge memory consumption (About 4.3 GB memory) and low frame rate. Could you please help me with this problem? My point class: class

5 replies1 file

Selecting points in AIS_Point programmatically

When using AIS_PointCloud with SM_SubsetOfPoints, you can select individual points through a box or polygon selection and getting the indices of the selected points as follows: Handle(SelectMgr_EntityOwner) aSelOwner = myAISContext->SelectedOwner(); Handle(AIS_PointCloudOwner) hPointCloudOwner = Han

0 replies

Custom polyline with individual colors for edges: make the segments selectable

I need a polyline with colored segments/edges and every individual edge should be selectable. Basically what you can do with BRepBuilderAPI_MakePolygon would serve my needs, except that I can't give colors to the edges (as far as I can see). The code below is an example only showing a few points in

2 replies1 file

PBR materials : textures tilings

Hello community. Is there any way to define a texture tiling for a material, without changing all objects linked to the PBR material UVs ? I'm using a XCAFDoc_VisMaterial object and defines its XCAFDoc_VisMaterialPBR object with textures (diffuse, normal, metallic...) and i would need to tile these

1 reply

7.5 => 7.8 : edge select on cube creates crash

I have a test program where I generate a cube and activate the edge selection with myAISContext->Activate(AIS_Shape::SelectionMode(TopAbs_EDGE)); In 7.5 it works fine, in 7.8 I get a crash in StdPrs_WFShape::Add at line 127 const Handle(Prs3d_LineAspect)& anIsoAspectV = theDrawer->VIsoAspect(); if (

5 replies

Low Frame Rate with ClipPlane and Capping Enabled

Hello, I am using the ClipPlane mechanism to implement clipping functionality in my application. In my scene, I am rendering several hundred AIS objects and have added a single clipping plane to them with the following code: Handle(Graphic3d_ClipPlane) aClip = new Graphic3d_ClipPlane(plane); aClip->

1 reply

How to curve wire offset

BRepOffsetAPI_MakeOffset apply only to wire(plane), if my wire Generated from Geom_Curve, How can I achieve offset

1 reply

Emscripten buliding OpenCascade WebGl example

Hello I am having trouble building the WebGL example for the past couple hours. I wanted to know first if for Emscripten do I need to build it from source or can I just follow the Installation instructions using the emsdk. ( https://emscripten.org/docs/getting_started/downloads.html ) The only reaso

3 replies

How to customize highlight selecte

Hello, everybody! I know how to display Automatic highlighting,It's about moveto.But as far as I know, const Handle(Prs3d_Drawer)& aPartSelStyle = myContext->HighlightStyle(Prs3d_TypeOfHighlight_LocalSelected); The above method can control the highlight status after the selection, aPartSelStyle->Set

1 reply1 file

Virtual object - highlight & selection

Hello community. I use AIS framework to display some 3D data and I create measure objects, such as distance and angles, and display them creating a root object and child objects (lines / arcs / labels). To do so, the root object I used is actually an AIS_Trihedron with its axes / arrows and labels h

2 replies2 files

Selection / picking does not work for simple shape

Hi gentlemen, I just checked that picking and selection are not working for a simple shape (OCC 7.8.0, windows 10, VS 2022). I wanted to register a bug in bug tracker but do not find a way, so I post it here. Please find in the attached .zip a brep file and a small tcl script to reproduce on you sys

2 replies1 file

Back facing question

Hello community. In my application, I have a custom treatment to generate back faces as single shapes because front and back faces should be distinguished as single entities when the user select a front / back face of a surface shape. Thus I specified my view calling the "SetBackFacingModel" method

4 replies

How to get objects under the given scene coordinates.

Hi, To find shapes under a rectangle area OCC provides "SelectRectangle" function from AISInteractiveContext which accepts pixel(view) coordinates. Is there any function to use scene coordinates to get shapes instead of pixel coordinates ? also Is it possible to only find the objects instead of sele

1 reply

How to set transparency of an AIS_Shape as a Wire

Hi, I would like to know if someone know how modify the transparency of a shape defined as a Wire. I have already tried the method SetTransparency() of AIS_Shape and SetTransparency() of ShadingAspect but it still not working. PS : I use my own WireAspect Thanks in advance, Nathan,

3 replies

AIS_TextLabel vertical alignement

Hello all. I'm facing a problem using AIS_TextLabel and the vertical alignement. I'm placing such object near to a line with the SetPosition function (in fact at the center of a line). When using the SetVJustification function with Graphic3d_VTA_TOP, the display is nice, there is a small space behin

2 replies3 files

Mesa3d Aspect_GraphicDeviceDefinitionError

Good afternoon, Currently I am building a small piece of code to make pictures of .stp files. The code will run on a system without any gpu/graphics, so I am trying to use the mesa3d software implementation of OpenGL. The code works, but when i call the method that creates a screenshot a second time

1 reply

AIS_Plane SetSize crash going from 7.5 to 7.8

The next code Handle(Geom_Plane) hRefPlane0; hRefPlane0 = new Geom_Plane(gp_Pnt(0, 0, 0), gpDirRef); Handle(AIS_Plane) hRefbottomPlane = new AIS_Plane(hRefPlane0); hRefbottomPlane->SetSize(500.0, 500.0); hRefbottomPlane->SetColor(Quantity_NOC_LAWNGREEN); aShapes.Append(hRefbottomPlane); worked in 7.

2 replies

Transform persistence of AIS_ColorScale derivation

In 7.5 I had a derived class from AIS_ColorScale which had a constructor like this: AIS_TrajectoryColorScale::AIS_TrajectoryColorScale(NODE_UUID iChannelUUID, bool bSmooth, int NumSegments) { ...... SetLabelType(Aspect_TOCSD_AUTO); SetZLayer(Graphic3d_ZLayerId_TopOSD); SetPosition(0, 0); // lower le

2 replies

MeshVS_NodalColorPrsBuilder cannot set materials

Hello, I want to make the surface of MeshVS_Mesh shiny, as shown in picture1. In the picture left model is created using MeshVS_MeshPrsBuilder , it can set the material through: meshvs_mesh->GetDrawer()->SetMaterial(MeshVS_DA_FrontMaterial, Graphic3d_NOM_SHINY_PLASTIC); But when I use MeshVS_NodalCo

8 replies2 files

OCCT Visualizer Widget Crash with Opencascade V7.8.0 In Debian

Hey, I would like to use the sample https://github.com/gkv311/occt-samples-qopenglwidget with QT Version 5.15.10 and opencascade 7.8.0. It was working as expected with the OCCT Version 7.6.0. While i was upgrading opencascade, I encountered a Segmentation Fault in the Init line of the code below. It

2 replies

How to modify BVH of the SelectionManager into an OCCT Viewer

Hello, I would like to know if it's possible to modify the BVH structure of a SelectionManager or even replace it with my own optimisation structure. I am currently working on some large AIS_Wire ? I also would like to know if there is an optimisation structure only for the visualization (i guess no

0 replies

Setting Z layer in Prs3d_Drawer

Hi, I created two Prs3d_Drawer with different Zlayer value and added two rectangular face shapes inside Compute function. Even though I set the different value of Z using the function Prs3d_Drawer->SetZLayer. It paints both the shapes with different colors that was set on Prs3d_Drawer objects. But I

0 replies

Project 2D screen point to 3D plane

Hello community. Today, I'm trying to create a custom manipulator and I'd like to know if there is a way to project a 2D point (mouse position) to a 3D point that is on a specific plane (using gp_Pln for example) regardless of the camera eye direction. I know the "Convert" function of the view but t

4 replies

Annotation

Is there any way to add Annotation in Viewer? Current I am achieved by using line and text. But I am not able to select that text after displaying it.

1 reply1 file

ZoomAtPoint with perspective view issue

Hi community. I want to implement a zoom on the cursor position but I have an issue or a misunderstanding of the "ZoomAtPoint" feature. First of all, I don't have the issue with orthographic projection, when zooming in this mode, my cursor always stays on top of the exact same point in the 3D view.

3 replies2 files

Value of Transformation changes when rotation or scaling is applied.

Case 1: When I move the the component in X by 500 and Y by 500 , then the transformation (local transformation) is given by API is X=500 Y=500 Z=0.00 (Refer image 1) Case 2: Now I am applying the rotation to X axis and Y axis by 50 each then the values of transformation is as follow : X: -281.79 Y=4

4 replies4 files

How to get the rotation value of each axis ?

Component is rotated around 45 degree around X and Y axis. I am trying to get the values after rotation. I tried following methods 1] By gp_Quaternion gp_Quaternion q =CurrentObject->LocalTransformation().GetRotation(); double aProbe, bProbe, cProbe; q.GetEulerAngles(gp_Intrinsic_XYZ, aProbe, bProbe

0 replies

No more AIS_SequenceOfInteractive in 7.8.0

Hello, while upgrading from 7.5.0 to 7.8.0 we no longer find the collection AIS_SequenceOfInteractive available. While it could easily be restored, I'm asking the reason of such a deletion! It has be found to be not efficient or something else? Do you have any suggestion for its replacement? Thanks

2 replies

Getting the TDF_Label from Selected Shape

I am having trouble figuring out how to get the TDF_Label from the selected object. I am trying to display the label when a user selects a shape in the viewer. TopoDS_Shape selectedshape = myContext->SelectedShape(); Gets the selected shape but I cannot figure out how to get the label from the TopoD

2 replies

qt6 and V3d problem

Hi guys, I have built a simple visualization program in qt with OcctWindow class and the description in the OCC document. The problem is the view can be showed, but only for a second(maybe less than that). I have tried to debug it, found that the view is good until the statement "return a.exec()” wa

4 replies2 files

Create 3d Viewer problem

I used to create 3d viewer by using OpenCASCADE 7.4 and MSVC 2019. I got a error at new in below, MyGraphicDevice = new OpenGl_GraphicDriver(aDisplayConnection); Can anyone tell me which header file use for new Please help me to solve this, View attached image

7 replies5 files

Rotate component using Manipulator.

Hello, I would like implement the functionality where I am attaching a manipulator to a component and then use the manipulator's rotation axis to rotate the component along different axes to place it correctly . After rotating the component, I want to save that transformation. Currently, I can attac

0 replies1 file

AIS_PointCloud How to change scale of points

Hello, When i use an AIS_PointCloud with his points and his PointAspect() with a variable scale Standard_Real pointSize {10.0}; Prs3d_PointAspect* pt = new Prs3d_PointAspect(Aspect_TypeOfMarker::Aspect_TOM_POINT, c, pointSize); pAisCloud->Attributes()->SetPointAspect(aspect); // pAisCloud is my AIS_

2 replies

Memory increase when MustBeResized is called?

Memory will increase when MustBeResized is called. Then it will not be released... Opencascade V7.4.0 PC OpenGL 3.1 Is there a way to release the memory? code >>>>> Handle_V3d_View m_view ... m_view->MustBeResized(); // <---- <<<<< code This problem does not occur on an OpenGL 4.6 PC. Best Regard!

4 replies

Qt6 & V3d_Viewer using occtWindow class implementation device pixel ratio issue

Hello there! I am having an issue with my implementation. I have created a QApplication which is based on a QMainWindow, with several widgets embedded to it. One of the widgets is used to visualize occt entities using a V3d_Viewer, V3d_View etc. In my implementation I use the following line of code

2 replies1 file

AIS_PointCloud select bug

With AIS_PointCloud ,I want to select points from two point clouds. After selecting the first point, when I select the second point, the first point should be deselected. How should I proceed? I tried using AIS_SelectionScheme_Add , but it doesn't work.

1 reply

AIS_ColoredShape, Set Material of sub-shape

Hey Everyone I was wondering if it's possible to set the material(Graphic3d_MaterialAspect) of each individual subShape of a AIS_ColoredShape object. Best regards

2 replies

Is it possible to draw a picture using OpenGL in the OpenCASCADE Viewer?

This question is similar to this: https://dev.opencascade.org/content/using-opencascade-opengl I understand that the Viewer is typically used for handling three-dimensional objects, but I have a requirement to draw an image using OpenGL in the OpenCASCADE Viewer and place it at the bottom of the Vie

4 replies1 file