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

Showing 60 discussions, ordered by the latest archived activity.

AIS_Animation:How to rotation arround an axis parallel to the Y-axis

I want to make the shape rotate around an axis parallel to the Y-axis. The final result is right,but the animation process is wrong,the shape will translate and rotate in the same time.It's because the shape will first dot translate Mat to XYZ then rotate then translate to the original position? How

1 reply2 files

Activating "turntable" mode in 7.5 AIS_ViewController

Hello, has anybody found a way of activating a mode in the AIS_ViewController where rotations are done only in the Z axis ("turntable mode")? I've tried using SetAllowRotation(true) + SetLockOrbitZUp(true) with AIS_MouseGesture_RotateOrbit or AIS_MouseGesture_RotateView and also various AIS_Rotation

3 replies

OCCT Visualization performance

As we know, FreeCAD decided to use Coin3D (OpenInventor) to increase visualization performance. So what about OCCT Visualization in 2021 ? Equal performance? may be better? or still worse?

3 replies1 file

Display Trihedron at origin

Hello, I am trying to display a trihedron in my AIS_InteractiveContext at the origin. I would like for this trihedron to show "on top" of all other objects. I am aware of V3d_Viewer::TriedronDisplay() but this does not move relative to the context, it instead stays anchored to one location in the vi

2 replies

How to display special characters with AIS_TextLabel

I want to show the relationship between two edges, and I use AIS_TextLabel to achieve this function. For example, there are two parallel edges, I use the code below, however, it doesn't work. I know it should be converted to a unicode string, and I can show it on the widget made by Qt. TCollection_E

2 replies2 files

What is the efficient way to display many arrow (quiver plot) in OpenCascade viewer

Hi guys, I need to display many 3D rows in OpenCascade viewer, the quiver plot (image is attached). I can do it by creating many TopoDS_Shape and displaying with AIS_Shape. But the point is it's getting slow to generate arrow shapes and display them. Do you guy have any idea to rendering the arrows

1 reply1 file

How to render BSpline surface using gluNurbs?

Hi all, I am writing about displaying Nurbs surface from TopAbs_FACE using gluNurbs. I searched about it from google. and I got snipped code. But I couldn't display nurbs surface on my program from snipped code. Please let me know what am I wrong. Handle(Geom_Surface) aGeomSurface = BRep_Tool::Surfa

2 replies

How to render BSpline surface using gluNurbs?

Searching the forum did not reveal any result. For now I just do it by the following code: uorder = hBSpline->UDegree() + 1; vorder = hBSpline->VDegree() + 1; uknot_count = hBSpline->NbUKnots(); vknot_count = hBSpline->NbVKnots(); uknots = new float[uknot_count]; vknots = new float[vknot_count]; //k

3 replies

Drag (move) objects with mouse

Dear developers and users, I want to move objects by clicking on them and dragging them to a new location. Is this possible in opencascade? I already know how to translate objects, so it's a matter of tracking mouse position (in the form of coordinates) when an object is selected. Any ideas how to d

2 replies

Selection of hidden objects with shiftselect

Hallo, I am using shiftselect to select several object with the rectangular area. This works fine so far but unfortunately objects that are behind other objects and can´t be seen from the view point, are selected as well. How can I change that behaviour that only objects/shapes that can be seen are

2 replies1 file

Hide AIS_InteractiveContext::Erase does not work the first time

Initially after loading CAD files (using STEPCAFControl_Reader for example), if I hide that object using AIS_InteractiveContext::Erase, it does not hide. When I then make if visible again with Display and then Erase it again, it finally becomes invisible and it works as it is supposed to. So why is

8 replies1 file

Animation shows the bending process of the pipe

Hi all I want to show the bending process of the pipe like a animation.But I don't know how to make the process more smooth,just like a continuous process. But I don't know how to implement this process Greatly appreciate any help

3 replies

How to prohibit Ais_Shape from being selected

I use AIS_Shape to display temporary geometries and prohibit these temporary geometries from being selected, but they are always selected now. How can geometry not be selected? Thanks a lot!

2 replies

Visualization using VIS

I am developing a C++ and OCCT based simple application on Mac OS Big Sur and trying to get visualization of the created STEP models (TopoDS_Shape) using VTK Integration Services (VIS) of OCCT. I installed OCCT on Mac using homebrew and I have the latest release of OCCT, 7.5.0. The problem I am faci

1 reply

Visualization using AIS

Hi, I am trying OCCT's visualization capabilities for the first time for a C++ based application on Mac OS Big Sur. I followed the user guide at https://dev.opencascade.org/doc/occt-7.5.0/overview/html/occt_user_guides__visualization.html#occt_visu_2 However, I was unable to get any visualization or

1 reply

How to display the glare effect

When the mouse is moved over the entity, how can the glare effect shown in the attachment be displayed? Thanks a lot.

0 replies1 file

Zoom to AIS_Shape

Hi OCC, Is there a way to zoom a AIS_Shape in the view?, So that the AIS_Shape is maximized in the view? Do you have any hints on how to achieve this? Thanks, Author

4 replies

Change color for highlighting when detecting a shape or compound

Hello, I am updating an application from OCC 6.7.0 to 7.5.0. Detecting of shapes or compounds in the viewer works well : - A colored wireframe is shown when moving the mouse over. Now I want to change the color by user for detecting. My Code is : try { myAISContext->MoveTo(point.x,point.y,myView,fal

5 replies

Threads vs AIS_Context

Good morning everyone, I have this thread who is in charge to display and update multiple (custom) objects within an AIS_Context. In the meanwhile the user might want to zoom/pan/rotate (using the mouse) the scene during the process. I'm experiencing some (random) crashes when this is done and I fea

2 replies

MeshVS_Mesh custom object

Hello, I'd like to create a custom interactive object displaying a Poly_Triangulation or, generally speakinig, a set of points organized in triangles. Is there a low level "graphic3d_" (or something) structure suitable for this task or should I display points and/or segments using Graphic3d_ArrayOfP

3 replies

Style Of Points

Hello I was wondering how to display shapes like points style like in the atachment?

8 replies1 file

Disable Shading

Hello I was wondering what is the path for displaying with no shading just original color ? Like in the shape in atachment.

1 reply1 file

ClipPlane does not work With OCC7.5

Hi deer! I am new to OCCT. I want to use Graphic3d_ClipPlane to clip 3D model. and my code as follow: void WidgetClipPlanes::setPlaneOn(Handle(Graphic3d_ClipPlane) &clipPlane, bool on) { clipPlane->SetOn(on); ... m_view->AddClipPlane(clipPlane); m_view->Redraw(); } but result is unexpected . the lin

3 replies1 file

Mesh selection - mesh highlight

Hello forum, => on Opencascade 7.3.0 - MSVC2015. I implemented mesh selection in an AIS_InteractiveContext using occMeshContext->Activate(meshVS,theMode) in which meshVS is a MeshVS_Mesh and theMode is one among MeshVS_SelectionModeFlags. The presentation builder was added in this way: occHandle(Mes

0 replies2 files

OpenGL question

Hello, My app has its own OpenGL context and objects are typically drawn by calling their DrawOpenGL method that typically looks like this : DrawOpenGL_3D( void ) const { glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glVertexPointer( 3, GL_FLOAT, 6*sizeof( GLfloat), Lef

3 replies

Custom AIS_InteractiveObject: different presentation when hilighted

Hello everyone, I'm trying to inherit from AIS_InteractiveObject in order to create a new object (usinig OCC 7.3.0) I've seen that, implementing properly the Compute() method I can build its presentation as desired (more or less). Of course I will vary its aspect according to "theMode" parameter in

2 replies1 file

Arrow Colors of trihedron

Hi, is there a possibility to assign different colors to the arrows of a trihedron? I can set a color to every axis of the trihedron in the following way: Handle(AIS_Trihedron) axissystem = new AIS_Trihedron(anAxis); axissystem->SetSize(10); Handle(Prs3d_DatumAspect)datumaspect = new Prs3d_DatumAspe

1 reply

Package Media

I use OCC for robotics, how can I use the Package Media to record the motion in V3d_View, I know the view can be dumped to an image. The package is based on FFmpeg, but it seems like to be designed for a video player. I can't find any output API in it.

1 reply

Bring to front

I am drawing some lines as topmost using SetZLayer(Graphic3d_ZLayerId_Topmost) It is displayed on top of all other objects but i want some other objects to bring front, so topmost lines will not be on top of these objects. Is that possible? I tried to change DisplayPriority but didnt work.

3 replies1 file

Displaying Bounding Box of AIS_SHAPE

I can get the bounding box of an Shape with shape->BoundingBox() but how can I display the bounding box in my current viewer?

1 reply

Progress Of Diplaying AIS_InteractiveObject

Hi I am displaying many objects thorugh recursive iteration. I can acess the reading and transfering progress with Reader().WS(); but how about progress of displaying shapes using Display() them ? I am displaying them in a recursive method. Is there a way to see the progress of displaying shapes?

3 replies

Hiding Context Without Erase

Hello I am Hiding my shapes with Erase() and unhide with Display() it works perfect but, if my file is too big ııt takes some time to Display, I wonder ıf there is a way to hide Context without Erase(); Like setting it transparent and unselectable/touchable.

1 reply

Ray-tracing requires OpenGL 3.1 and higher

I use OCCTOverview, when I clicked Ray-tracing button, I get this error: TKOpenGl | Type: Error | ID: 0 | Severity: High | Message: Ray-tracing requires OpenGL 3.1 and higher my platform is MacOS wtih occt 7.5, Does anyone know how to set OpenGL version? or use QSurfaceFormat as version seter? Thank

13 replies10 files

Update vizualized object

Hello, I'm quite new to OpenCascade. I've successfully built a simple object from boolean a operation: a cone cut by a sphere. I've also been successful in displaying this object using the code: // Display Object TopoDS_Shape myShape1 = MakeObject(); Handle(AIS_Shape) AIS_Shape1 = new AIS_Shape( myS

2 replies

UnsetColor may not work as expected

Hi, I loaded colored sample cubes as XCAFPrs_AISObject's into a scene. When loaded it automatically extracts the colors specified on the shape. When I do SetColor, color changes and after using it I like to UnsetColor. I was thinking that unsetting will revert to original color specified by shape an

2 replies3 files

Is UpdateCurrentViewer() ,from AIS_InteractiveContext, thread-safe?

Hello there, I'm working on MFC samples, specifically, Animation sample but while the fan is moving I cannot do any other functionality like zoom-in, select it... In other words, when I do so the movement of the fan is stopped. After searching I get the reason, which is all these functionalities are

6 replies

Boundary Color

Handle(AIS_Shape) ais_Shape = Handle(AIS_Shape)::DownCast(aIO); ais_Shape->SetColor(aQC); ais_Shape->Attributes()->SetFaceBoundaryAspect(new Prs3d_LineAspect(Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.)); aCtx->Redisplay(ais_Shape, Standard_False); if i change the AIS_Shape color using above way it wor

1 reply

StdPrs_WFDeflectionRestrictedFace produces overly dense sampling

Hello all I am upgrading from 6.9.1 to 7.5.0. There are good changes, particularly with new handles. One thing, which looks brocken is the StdPrs_WFDeflectionRestrictedFace:: Add (const Handle< Prs3d_Presentation > &aPresentation, const Handle< BRepAdaptor_HSurface > &aFace, const Standard_Boolean D

4 replies1 file

Aspect_Grid transparency

Hi Friends, Does anyone knows if is there a way to change the opacity of an Aspect_Grid? Thanks, Author.

0 replies

Add AIS_ColoredShape to XCAFDoc_ShapeTool with CustomAspects

Hi, I am trying to add AIS_ColoredShape to the XCAFDoc_ShapeTool. Here is my code: TDF_Label addColoredShape(const Handle_AIS_ColoredShape& coloredShape, const Handle_XCAFDoc_ShapeTool& tool) { TopoDS_Shape shape = coloredShape->Shape(); TDF_Label shapeL; TopoDS_Builder builder; TopoDS_Compound comp

0 replies

The view problem of occt7.5 on Qt

I had wrote the code by referring the sample code of occt7.5. However, I met a problem. When I run the program, the view of occt cannt show on the QWidget. When I open anthoer window on the view, the view will not display. I have to input an occt command to display the view when I meet the same prob

0 replies

Mixing Text and Triangles in Graphic3d_ZLayerId_TopOSD

Hello, I would like to display some shaded box (opaque) with text inside it. I have a custom AIS_InteractiveObject for this task. The problem is that when I set the layer of the object to Graphic3d_ZLayerId_TopOSD, all the primitive I use to compose this object seems to be on the same depth. I tried

3 replies3 files

Change view orientation like AIS_ViewCube

I am using the V3d_View::SetProj to change view orientation and i also use AIS_ViewCube. Is that possible the animate SetProj like AIS_ViewCube?

2 replies

Memory not released after Remove function.

Hello, I wish to express my gratitude for OpenCASCADE developers. I have a question about OpenCASCADE 6.3 usage. I used OpenCASCADE as follows. (1) Set AutoActivateSelection OFF. myAISContext->SetAutoActivateSelection(Standard_False); (2) Create 3D object. gp_Pnt point(0.0, 0.0, 0.0); gp_Dir directi

6 replies

how to display colors when step file is loaded (display drawing colors)

Hi, I can't get the colors loaded from the step file when using the reader. If i use the standard reader it displays the stepfile without colors : STEPControl_Reader Reader; Reader.ReadFile("delta_complete.step"); std::cout << Reader.TransferRoots() << " Reader roots transferred." << std::endl; Topo

7 replies

How to change the face color of a selected topods_solid?

I can selected a face of a soild by using the MoveTo function, and get the topods_face by the DetectedShape function. However, I can't change the face color, because the functions in the AIS_InteractiveContext can't return the topods_face pointer. Is there other way to change the color of a topods_f

1 reply

how to display colors when step file is loaded (display drawing colors)

Hi, I am new to OpenCascade, i have a little problem. My first app is working as aspected, special thanks to Mr. HuguesDelorme He helped me with my first problem, rotating was very slow. That is solved. My app code : https://github.com/grotius-cnc/Skynet_Robot_Control_Rtos_Ethercat My problem : The

0 replies

Issues Rendering Textures in WebGL

Hello! I've been attempting to render a texture via WebGL using the latest OCCT release (7.4.1 beta), but I can't quite get it to work. Ultimately the end result is a black surface and a browser warning: "RENDER WARNING: there is no texture bound to the unit 0". I'm compiling via Emscripten, and hav

8 replies2 files

Zoom persistence and AIS_Trihedron

Hello, I'm having troubles with AIS_Trihedron + zoom persistence. I don't understand clearly how to make it work. I display an AIS_Trihedron located at some gp_Ax2 placement, this is working fine. Now to make that 3d object size "independent" from view zooming : aisTrihedron->SetTransformPersistence

2 replies

Independent color for AIS_ConnectedInteractive

Hello, I am trying to apply different colors to several linked AIS_ConnectedInteractive to the same AIS_Shape. But could not make it work. The SetColor function on AIS_ConnectedInteractive seems to do nothing. I am using OCCT 7.5. I already executed the example provided in the draw program: vinit bo

0 replies

How to select entity owners manually

I have an application where I'm keeping some references to the topological data in the form of TopoDS_Shape objects and using AIS to display this data in the form of AIS_InteractiveObject s. However, I'm having a difficult time trying to figure out how to programmatically select an entity owner that

1 reply

Display boundary edges of mesh solid

Hi, is there a way to display only boundary edges of a mesh solid? Using FaceBoundaryDraw and FaceBoundaryAspect works for TopoDS_Shape, but not for mesh object. Other graphic libraries get the result working only on opengl shaders parameters, so I'm wondering if there is a way to get this. Of cours

0 replies2 files