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

Showing 60 discussions, ordered by the latest archived activity.

How to update an AIS_Animation when it is paused

Hello! I have an AIS_Animation animation and I try to implement Next or Previuos buttons user interface actions of a toolpath simulation. The animation works perfect, but at some time I like to paused it and move the tool in the next position of the toolpath depending on the current paused position.

1 reply

Anti-aliasing function setting didn''t take effect in CentOS system

Hello everyone, I used the following code to implement anti-aliasing, but it didn't work on Linux. Looking forward to your suggestions! mView->ChangeRenderingParams().IsAntialiasingEnabled = true; mView->ChangeRenderingParams().NbMsaaSamples = 4;

0 replies

2d text on screen

Hi how can I put text on occ screen? i am using sample qt-occ widget and I tried using QPainter (in paintEvent) to draw text. At first its fine, it draws the text but any change on screen (any dialog opened or any shape drawn) erases the text and I couldn't find a way to draw it back. Thanks for rep

10 replies3 files

AIS_Triangulation color is incorrect

Hello, The color of AIS_Triangulation seems to be combined with color of model's default material, how can I cancel this color of material to display the vertex color correctly? Looking forward to your answer.

2 replies1 file

How can I use V3d_View::SetBackgroundImage() in linux(CentOS7.9)?

Hi everyone, When I used V3d_View::SetBackgroundImage() under the Linux system, the background was displayed as full black (as shown in the figure). Then I added FreeImage.so file, but still could not work. How can I solve this problem? Thanks

0 replies1 file

How to save and load current view point in OpenCASCADE?

Hi all, I am working on a project using OpenCASCADE, and I need to save the current view point (camera position) and later load it again. How can I do that in OpenCASCADE? I have tried searching for solutions, but so far, I have not found anything that addresses this specific issue. Any help would b

1 reply

AIS_PointCloud redisplay

Hello all, how to redisplay a AIS_PointCloud after removing some points? Thank you :) Handle(SelectMgr_EntityOwner) object = objects.at(i); Handle(AIS_PointCloudOwner) pointCloudOwner = Handle(AIS_PointCloudOwner)::DownCast(object); Handle(TColStd_HPackedMapOfInteger) points = pointCloudOwner->Selec

3 replies

Combine AIS objects

Hey everyone I'm trying to visualize a .3DS file with ASSIMP library. I've subclassed AIS_InteractiveObject and made my own class, AIS_Mesh . Like in the tutorial . I have parsed the ASSIMP scene to a mesh, this in the ::compute method with Graphic3d_ArrayOfTriangles for the triangles and Graphic3d_

4 replies

How AIS_Shape display grid border

Hey everyone The wire displaymode in AIS_Shape is brep's boundary, how to display meshes as triangular patches? Thanks!

1 reply

Display object param

hi, may I ask for help? I have c++ example project from Udemy.com. When I draw line, I want to add event OnClick, and display MessageBox with start and end point. How to do it? Thank you very much. // Display 2d Curves for (int i = Curves2d.Lower(); i <= Curves2d.Upper(); i++) { Handle(Geom2d_Curve)

0 replies

Remove an element of Graphic3d_ArrayOfPrimitives

Hello! Just as it is possible to add a series of vertex / edges using AddVertex / AddEdges, it is also possible to delete / remove this kind of them from a Graphic3d_ArrayOfPrimitives array? Thank you!

12 replies

TPrsStd_AISPresentation with wrong location / position

I try to read step file with opencascade, there are several ways to display the bodies in step file, but when I use TPrsStd_AISPresentation, the location of bodies will go wrong some times. AND when I use method prs->GetAIS()->SetLocalTransformation(loc) to change the location of the AIS Object of T

7 replies2 files

SetVertexColor different results

Hello! I got different result using SetVertexColor on an Graphic3d_ArrayOfPrimitives elements, as you can see from the pictures attached. myPArray->SetVertexColor(index, 0, 0, 1); // ok! myPArray->SetVertexColor(index, Quantity_NOC_BLUE); // the array elements are displayed in other color than blue!

2 replies2 files

Crash after Windows update

Hello all, since ever (7.5,7.6,7.7) I can use raytracing and global illumination. Now, when I switch to RT or GI the application crashes. When I try to debug - no error shows up. I ran an old setup of my app which is running on multiple other machines to see if I made a programming error and it cras

3 replies

display: how to hide a solid within an AISColored shape made of a composite solid

Hello forum, I would like to hide a solid within an AIS_ColoredShape build with a TopoDS_CompSolid. After the solid subshape has made hidden, I would like to make it unselectable. As explained in this old post: https://dev.opencascade.org/content/display-how-hide-face-within-aiscolo... , and in the

2 replies

Debugging OCC

hi, dear Open Cascade developers, I am learning OC, and try to understand some lines of code like this: void COCCViewerDoc::DisplaySketch() { if (bIs2d) { // Display 2d Curves for (int i = Curves2d.Lower(); i <= Curves2d.Upper(); i++) { Handle(Geom2d_Curve) L = Curves2d.Value(i); GetView()->DisplayC

0 replies1 file

simple example of Open Cascade 7.5 application

hi, Today I try with simple example of Open Cascade 7.5 application I don't have one file: Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'Graphic3d_WNT.hxx': No such file or directory WindowsProject1 C:\Users\pdusp\source\repos\WindowsProject1\Wi

3 replies

CustomAspects: a subshape made hidden is selectable

Hello forum, please see the attached document. I loaded into a viewer two cubes, two AIS_ColoredShape (Fig. 1) I created a composite solid, one single AIS_ColoredShape (the previous are removed from the display) (Fig. 2) I hid one of the cubes of the composite solid, acting on the AIS_ColoredDrawer

15 replies5 files

CAD kernel for a voxel based geometry

I am having a very hard time visualizing a octtree/voxel/geomtric column type geometry. Is there another CAD kernel besides OpenCASCADE that would work better? Basically, a forbiddingly vast amount of time and RAM is going in creating each voxel and gluing it with other voxel.

1 reply

AIS_Trihedron different behavior for two project

Hello everyone, I have two project and one of them is written with c#, for this project I use OCCTProxy. Other project is written with c++ and I have a problem with AIS_Trihedron. For c# project for width of each axis on Trihedron I use these code parts below: gnomon_->Attributes()->DatumAspect()->L

6 replies

V3D_Trihedron line width

Hello everyone, I create a trihedron with code below but could not set line width of axes. Anybody knows how to set line width of axes? v3d_view_->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_BLACK, margin_rate_); Normally AIS_Trihedron has a attribute which is DatumAspect() and we can set w

5 replies

Animation does not work on c++ project

I have two project which are written in c# and c++ with qt. In c# project I use OCCTProxy and animation works like a charm. But when I use same code for a sample project I mean c++ project (add link for that), does not work at all. I definitely don't understand what is the difference between them. I

0 replies2 files

Ais_shape Setcolor but remain origin eadge color

I try set ais_shape color but remain orgin edge color, i use code below , it works ais_shape = new AIS_Shape(shape); ais_shape->SetTransparency(transparency); ais_shape->SetColor(color); const Handle(Prs3d_Drawer) contextDrawer = ais_shape->Attributes(); contextDrawer->SetFaceBoundaryAspect(new Prs3

1 reply

Displaying/Clearing Primitive Arrow as Graphic3d_ArrayOfTriangles

Hello, I displaying an arrow in a Graphic3d_ArrayOfTriangles. Handle(Graphic3d_Structure) arrow3DStructure = new Graphic3d_Structure(myViewer()->StructureManager()); Handle(Graphic3d_Group) group = arrow3DStructure->NewGroup(); group->SetGroupPrimitivesAspect(arrowAspects()); group->AddPrimitiveArra

0 replies

Cut a shape after importing a stl file

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

3 replies

Import STL with good quality

Hello everyone, I use the code below to import a STL file and to show that on view. But actually there is a difference between reel stl file and imported stl file. Generally same but looks different and imported like bad quality. So is there an opinion to get better my visualization? TCollection_Asc

2 replies2 files

mesh selection style

Hello forum, I displayed a mesh, and activated the selection of elements. If I select some elements they are shown as in the attached picture, that is using a grey shrinked wireframe. I would like to shown the selected elements with a solid color, or in another way. How to change the default behavio

0 replies1 file

Example on how to setup offscreen rendering for OCCT + Qt5 QML

Hi everyone, I'm looking for a minimal example on how to use OCCT (7.4) for offscreen rendering onto Qt5 QML. I plan to be able to render through the Qt/QML QOpenGLFramebufferObject , which seems to be the way to go to implement such feature. The idea beeing to be able to put as many of these items

3 replies1 file

Possible bug in vtk picker?

I am using occ vtk VIS services as so: IVtkOCC_Shape::Handle aShapeImpl = m_geometryShapes[anIt.Value()]; IVtk_ShapeIdList anIdSubList = m_picker->GetPickedSubShapesIds(anIt.Value(), false); vtkSmartPointer<IVtkTools_ShapeDataSource> aDataSource = vtkSmartPointer<IVtkTools_ShapeDataSource>::New(); a

3 replies1 file

OpenGl_GraphicDriver, FAILED to release OpenGL context,EGL, eglTerminate FAILED

Hi Forum, I established a docker, the system version show as follows: Linux version 3.10.0-1160.45.1.el7.x86_64 ( [email removed] ) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ), SMP Wed Oct 13 17:20:51 UTC 2021 CentOS Linux release 8.4.2105. The Graphicscard infomation show as follows: 00:

8 replies2 files

Camera zooming to the center of a model

Now camera zoom performs like that: I track mouse pointer coordinates and camera zooms towards these coordinates const Graphic3d_Vec2d aNewPos2d = myView->Window()->ConvertPointToBacking(Graphic3d_Vec2d(theEvent->x, theEvent->y)); const Aspect_ScrollDelta aScroll(Graphic3d_Vec2i(aNewPos2d + Graphic3

1 reply

How get coordinate axis center position in pixels ( relative to the screen )?

I want to get the position of the center of the coordinate axis relative to the screen ( in pixels ) in order to always zoom my camera not to the center of the screen, but to the center of the coordinate axis, where my displayed model is located. Aspect_ScrollDelta takes zoom point coordinates based

1 reply

Subview always stays at Left-Bottom regardless the arguments of V3d_View::SetWindow

Hi guys, I want to place OCC subview at some position inside the main view, but no matter how I input the V3d_View::SetWindow arguments (theCorner, theOffset, theMargins), my subview always stays at the Left-Bottom of the main view, it looks like only theSize is able to control. Do you know an alter

8 replies1 file

OCC & QtQuick: How to make OCC rendering within an area, not entire Window?

Hi guys, I'm trying to experience with OCC Visualization inside QtQuick, the build-in example renders OCC graphics entire window (WNT_Window), other projects using Occ/QtQuick I found do the same. Do you know how to render OCC within a area of the QtQuick application window? (ex. inside an QML Item,

2 replies

I want to change the material when I load the Step file.

I'd like to modify the Step file in the loading part. I want to change SetMaterial. bool ImportStep(const TCollection_AsciiString& theFileName) { STEPControl_Reader aReader; IFSelect_ReturnStatus aStatus = aReader.ReadFile(theFileName.ToCString()); if (aStatus == IFSelect_RetDone) { bool isFailsonly

0 replies

I want to prevent AIS_Trihedron from being deleted.

I hope AIS_Trihedron is not deleted. I hope the AIS_Trihedron is fixed. The current code is as follows. Handle(Geom_Axis2Placement) axis = new Geom_Axis2Placement(gp::Origin(), gp::DZ(), gp::DX()); Handle(AIS_Trihedron) aisTrihedron = new AIS_Trihedron(axis); aisTrihedron->SetDatumDisplayMode(Prs3d_

1 reply

Nvidia RTX performance

Hello all, when I render CornellBox in Cad Rays the GPU load goes up to 100%. when I do the same scene in OCCT the load goes to max 25%. Is there a setting I miss to use the full potential of my GPU? Thanks!

1 reply

How to check if the model is out of the camera Frostrum?

Hello! I have a problem with camera movement inside a viewport. I want to check if the model is outside of camera view and if it is I want place the model back to camera view. Would greatly appreciate your help!

0 replies

dynamic highlight of mesh - first and second order

Ciao in the two attached pictures you can see what is happening when I hover the mouse on the mesh of a cube, when the mesh is a first order one, and when the mesh is second order. In particular here the mesh is all tets (4 and 10 nodes for 1st and 2nd order) If the mesh is first order the right tri

0 replies2 files

Lights

Hello all, I am really struggling with the lights. Not all properties are working in all RenderModes For example: setDirection or SetConcentration with V3d_SpotLight works with Rasterization but not with Raytracing or Globalraytracing. SetIntensity with V3d_SpotLight works with Raytracing or Globalr

2 replies

How to prevent the model from going outside the viewport

Hello! I have a problem with model movement inside a viewport. Now I can move the model outside of the viewport boundaries, but I want to set a padding to the viewport for preventing the model from going to nowhere. I want always see the model inside the viewport and block moving it out of the windo

0 replies2 files

Blur Shadow only with V3d_DirectionalLight

Hello All, Only when I use V3d_DirectionalLight as light source I get realistic shadows with blurring out edges. V3d_SpotLight and V3d_PositionalLight always produce sharp edges. Am I doing something wrong? Thanks, Duesentrieb

0 replies2 files

wireframe view - change the line thickness

Hello, I would like to change the thickness of the lines in the wireframe view of an AIS_Shape, for example to have thicker lines. How to do that? Thanks in advance Author

2 replies

HilightWithColor/Unhilight

Hello, the call: anOwner->HilightWithColor(occContext->MainPrsMgr(), aDrawer, ...); in which - anOwner is a StdSelect_BRepOwner, - aDrawer is a Prs3d_Drawer - occContext my interactive context is able to highlight a subshape of a shape, in which anOwner is the owner of the subshape. In order to remo

3 replies

AIS_ViewController::PickPoint - Failed to project box

Hello, I'um using the AIS_ViewController::PickPoint routine to identify a shape under the mouse and get it's world coordinates. The functions throws a lot of errors: *** ERROR: ASSERT in file '.../SelectMgr/SelectMgr_Frustum.lxx': Error! Failed to project box (aMaxB >= aMinB) The detection of sensit

0 replies

Failed to host V3d_Viewer in WPF HwndHost.

Hi experts, I am trying to replace the WinForm host in WPF sample by WPF HwndHost, but V3d_Viewer doesn't display in the expected WPF control. I referenced this article to use HwndHost and my test project is attached. To run the test project, follow the steps below: Open the solution in VS2022. Modi

0 replies2 files

Graphic3d_ArrayOfPrimitives having transparant sections

With Graphic3d_ArrayOfPrimitives I visualize measurement data coming from a 3D photogrammetry system. Some sections of the data can be invisible (in the measurement data invisible parts are coded as NAN). To handle these invisible sections, I want make the vertex from the last visible point to the n

4 replies

I want to fix the Trihedron.

HI :) I am developing in .net. Trihedron continues to move. I want to fix it. I'd like to change the location of Trihedron. I want to change the location of the ViewCube. code //ViewCube Handle(AIS_ViewCube) aisViewCube = new AIS_ViewCube; aisViewCube->SetBoxColor(Quantity_NOC_GRAY75); //aisViewCube

1 reply2 files

How to set the bounding box for handdrawn objects

I have a custom implementation of a AIS_InteractiveObject where GL_ARRAY_BUFFER are managed directly because they're originating from an external library and copying them into Graphic3d_ArrayOfPrimitives would double the used resources (they're send through a callback and are directly uploaded to th

2 replies4 files

Not zoomable AIS_Trihedron object

Hello everyone, I want a trihedron which should not be zoomed in or out, I mean, trihedron should be same size when zoom in or out. Actually I managed that with "SetTransformPersistence" but doesn't work exactly as I want. For example I give a point as (300,0,0) and will create a trihedron on this p

1 reply1 file

AIS_Trihedron SetTransformPersistence Problem

The trihedrom is located wrong place. Handle(AIS_Trihedron) MyCreateTrihedron(gp_Ax2 thePos) { Handle(Geom_Axis2Placement) axis = new Geom_Axis2Placement(thePos); Handle(AIS_Trihedron) anAisTrihedron = new AIS_Trihedron(axis); Handle(Graphic3d_TransformPers) trsf = new Graphic3d_TransformPers(Graphi

2 replies

Misalignment issues for using QT6

Hi When occt 7.6 is used with Qt viewer windows has misalignment with windows. Or the mouse pointer and marker locations are different. It does not happen with Qt 5.15.2 Attached is the screen of the sample occt viewer. (Location of mouse pointer is different from market on screen). I also compiled

2 replies1 file