Forum archive

Visualization

Technical discussions preserved from the public OCCT community forum.

Topics
66
Replies
235
Files
122

Discussions

Page 1 of 2

Showing 60 discussions, ordered by the latest archived activity.

Issue with AIS_RubberBand Visualization

I am currently using AIS_RubberBand to display a selection rectangle on the screen. However, when the View's width is significantly longer than its height (approximately a 4:1 aspect ratio), the Rubber Band is visualized in the wrong position. This issue is also reproducible in the standard Sample w

1 reply1 file

Temporary Shape Visualization

Hello everyone. I am new to this repo. I am trying to create temporary shape visual while drawing line for my mini CAD program. This is my code snippet that updates and redisplays line while mouse moving. But if i move mouse fastly, it crashes. How to solve this problem properly? Thanks. bool showTe

2 replies

Evolution of TKMeshVS component

Preface Open CASCADE Technology contains TKMeshVS - a component completing the AIS classes from TKV3d component with capabilities to display mesh structures not necessarily bound to any TopoDS_Shape . TKMeshVS does not define any own data structure for storing mesh information; instead, it defines q

5 replies

Please look at the code. The error continues.

An exception occurs and I don't understand why. All values ​​are entered, but an exception error occurs when the 581st for loop is executed. Please help. for (int i = 1; i <= triangles.Length(); i++) { try { Poly_Triangle triangle = triangles.Value(i); int n1 = 0, n2 = 0, n3 = 0; triangle.Get(n1, n2

5 replies1 file

Viewer webassembly and static linking in a single webassembly

When using a webassembly based on sample to make a client side viewer in a commercial use, should i separate the OCCT code and use dynamic linking instead of a single webassembly file if i want to keep my additional code proprietary. Otherwise, are we in case of static linking to avoid of LGPL2? htt

2 replies

How to move the BVH?

Dear developer: In my project, there are 6 shapes. And I try to detect the collide sitituaiton in animation. One shape is fixed, and other shapes are keep moving. Each shape have a BVH_Box. After shapes moved, I don't want to recompute the shape's BVH, the cost is expensive. I want to apply the gp_T

2 replies

GPU support

Sup OpenCASCADE, I'm an inventor/researcher coming to OpenCASCADE for modelling and meshing, and I am looking for a tool that would be able to run 100% on GPU, or even TPUs (tensor processing unit). I'm building something that needs high performance(AI/ML), and that something shouldn't query CPU at

2 replies

Lesson 2: Bring OpenCascade and VTK together

I am following OpenCascade tutorials but am using window10 with VS 2019 IDE. I have installed OpenCascade 7.7.0 and VTK 6.1.0. At first, the compiler didn't recognize vtkNew but this was solved by adding #include <vtkNew.h> But then I got squiggles on these 5 lines: renwin->AddRenderer(ren); iren->S

3 replies5 files

OpenCASCADE Animation function not work

Hi Everyone: I have tried to use AIS_Animation and AIS_AnimationObject to do a basic Two-link Animation. And when I click the Winform button, then start to play animation. The animation code is written in the OCCTProxy project, which is a function. But when I clicked, things did not happen. And here

7 replies

PBR materials and transparent textures

Hello community. Is there any way to use transparent textures for PBR materials diffuse and let transparent section be really transparent on shapes where the material is applied ? I use the texture in the attached picture, but it gives me the result of the other attached picture, pbr_occt.png (emiss

5 replies4 files

Rendering performance counters

Development branch of Open CASCADE Technology (will be available in OCCT 7.3.0) introduces a new small feature for analyzing rendering performance issues #0029346. Graphic3d_RenderingParams structure has been extended with a set of new properties for collecting and displaying performance counters in

4 replies3 files

Change view orientation through AIS_ViewCube not work

Hi, I try to use the AIS_ViewCube to change the view orientation. I write it in my project, but nothing happens when I click the plane of the cube. Does anyone know if there need to set something? The version of occ is 7.5.0, here is my code. /// <summary> /// Initialize a viewer /// </summary> bool

0 replies

Transparency for unlit textured AIS_Shape

Hello everyone! I have a transparent AIS_Shape, which I create like this: auto ais_shape = tira::xocc::makeHandle<AIS_Shape>(TopoDS_Shape{}); ais_shape->Attributes()->SetShadingModel(Graphic3d_TOSM_UNLIT); ais_shape->Attributes()->ShadingAspect()->Aspect()->SetAlphaMode(Graphic3d_AlphaMode_Blend, 0.

0 replies

Regression from 7.3.0 to 7.4.0

I noticed this very annoying regression in visualization. The object seems topologically correct, but something in the translation to OpenGL must happen? See the attached picture for the end result of the code below (C#, snippet appended to the sample project importExportWPF): TopoDS_Compound comp =

9 replies3 files

When I use VTK, IVtkTools_ShapeDataSource error

Hello everyone, This problem has troubled me for several days. I try to compile OCC and VTK,But no effect. My configuration: vs2019 + occ 7.6 +vtk 8.2/9.1 this is my simple code: #include <BRepPrimAPI_MakeBox.hxx> #include <IVtkTools_ShapeDataSource.hxx> #include <vtkType.h> #include <vtkAutoInit.h>

6 replies

TKOpenGl Frame Render Graph

This article provides a high-level overview of a frame rendering graph implemented by TKOpenGl ( OpenGl_GraphicDriver ). Although it is named here as a “graph”, it’s not that flexible and the overall structure looks pretty flat, as could be seen later on diagrams. Article might be useful to OCCT dev

2 replies11 files

Disable shadow casting for AIS_Shape

Hi, I have a scene with AIS_Shape's which cast shadows. And I want some of them (e.g. shapes created from wires) do not cast shadows. Is this possible to do in opencascade? Kind regards

1 reply

Path tracing producing awkward artifacts

Hello, I have defined a scene and use it to render images using path tracing with OCCT770. The components of the scene are: - a CAD modell (stud) - light source (V3d_PositionalLight) - a grid that is placed in front of the light source (stripes) - a camera The generated stripes do not seem to be rig

9 replies4 files

CADrays Adding and displaying Camera views

Hi! I've been using CADrays for about 6 months and love the software's capabilities. I am wondering how to save camera views so then if I need to zoom in or out to change something, I can go back to one of the camera views I saved. This is a really important feature for me and appreciate any directi

0 replies

How to display the triangulation of the model?

I need to display the triangulation of a Step model.Now I could use TopExp_Explorer to get each face in this model and get all triangles.How can I display one of these triangles ? BRepExtrema_ShapeList aFaceList; for (TopExp_Explorer faceExplorer(aisShape->Shape(), TopAbs_FACE); faceExplorer.More();

0 replies

Selection Problem of MyAisObject in OCC7.7 turtorial

The selection and pick of custom AIS objects in OOC is something I haven't quite figured out. There is finally a section in occ7.7.0 that addresses this issue.(https://dev.opencascade.org/doc/overview/html/tutorials__ais_object.html) I tried the example in the draw toolkit and it worked as described

0 replies

How to solve the problem of model aliasing?

Question1: I use OCC's visualization module to display the model. However, I found that the edges of some simple models were seriously aliased when they were being visualized. Is there any way to reduce the impact of aliasing in OCC Visualization without modifying the model file? For example, when I

1 reply1 file

How do I alpha test a given color in an image to make it transparent?

On the 2D layer, I tried Sample2D_Image and AIS_TexturedShape and set their AlphaCutoff, but nothing happened. Here is my code: // create the textured shape Handle(AIS_TexturedShape) myTexturedShape = new AIS_TexturedShape(MakeIconShape(size, size)); // set the image Handle(Image_AlienPixMap) anImag

2 replies1 file

Triedron SetLabel Function won't display labels

Hi, I am creating a function to display the Triedron in the <0.0,0.0,0.0> point. The triedron is displayed fine with correct colors , but without "X" , "Y", "Z" labels How to fix? Where I am wrong? Thanks in advance, for any suggestion This is the code: Handle_AIS_Trihedron MyOcc::createTrihedron()

0 replies

AIS_Triangulation selection not implemented?

Hello, I cannot get the selection of a AIS_Triangulation. Indeed, ComputeSelection() is void implemented, at least in 7.4.0: void AIS_Triangulation::ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/, const Standard_Integer /*aMode*/) { } Poly_Triangulation is not a TopoDS_Shape, so

4 replies

Stereoscopic rendering in Open CASCADE Technology

Stereoscopic rendering has been first introduced in Open CASCADE Technology 6.8.0 . Initial support has been limited to shutter glasses and off-screen rendering. OCCT 6.9.1 improves this functionality and extends the list of supported consumer display devices. Archived image: external image break Ov

3 replies7 files

Render text based on zoom level

Hi, I have hundreds of polygons and want to display text on each polygon, Texts should appear and disappear dynamically based on zoom level. For example in QT there is option called LOD(level of details), while painting any QGgraphicsItem we can check the LOD value and discard painting. Is there any

0 replies

Select a vertex, an edge and a face with mouse

Hi everyone, I want to have vertex, edge, face or full body selection on AIS_Shape according to selection mode. Actually, if the vertex that I want to go from is selected, I need to obtain the coordinates of the vertex. If edge is selected I need to calculate the length. Surface area even if face is

2 replies

OCCT PBR in WebGL 1.0

OCCT 7.5.0 has introduced PBR (physically-based rendering) metal-roughness material workflow in it’s real-time rendering engine. This feature brings more realistic rendering of metal materials and, which might be even more important, an industry-adopted material definition supported by many 3D appli

0 replies4 files

gl2ps removal from OCCT dependencies

Historically, OCCT 3D Viewer provided two options for dumping view content: V3d_View::ToPixMap() saving an image screenshot (bitmap) into formats like PNG, BMP, JPG. V3d_View::Export() exporting into vector graphics image format into formats like SVG, PDF, PS. The latter one was provided with help o

3 replies

SetTransformPersistence strange and unwanted behavior in 7.5.0

Hello I have found a strange and unwanted behavior in visualization component in version 7.5.0, while up to 7.4.0 it was OK. I'm talking about trihedron kind of TransformPersistence. You can set TransformPersistence for an object at a defined x,y distance from each corner of the view, and it shows i

2 replies

PBR in OCCT 3D Viewer

Forthcoming OCCT 7.5.0 release extends its real-time rendering engine with a PBR (physically-based rendering) mode. OCCT implements PBR metal-roughness material workflow described by core glTF 2.0 specifications and also includes glTF data exchange components. New functionality opens a door to a new

0 replies11 files

OCCT 3D Viewer becomes sRGB-aware

Before talking about sRGB, lets figure out what was wrong with old OCCT 3D Viewer. Take a look onto a pair of screenshots: Archived image: external image Sphere lighting before (left) and after (right) switching to sRGB-aware renderer. The left image demonstrates a soft transition of a light into a

0 replies9 files

Improved Mesh Edges Presentation

Mesh displayed in 3D Viewer may come from different sources - imported from external file (glTF, JT , STL, PLY, OBJ), computed for analytical BRep geometry by BRepMesh (part of OCCT) and ExpressMesh (OCC component) algorithms or generated directly by application code. The mesh is usually displayed s

0 replies11 files

VTK integration services in OCCT

OCCT provides built-in Interactive Services based on own OpenGL-based Visualization component. The basic functionality consists of but not limited to presentation and selection of topological shapes (TopoDS_Shape), which are the key objects in OCCT, but also various presentations for arbitrary mesh

6 replies7 files

Status of NIS

Hi all, just for interest: will there be further development of NIS? Or would it make sense merging NIS functionality in the "Standard visualization"? Greets, Author

10 replies

Local Context removal

Local Context was an essential part of OCCT 3D Viewer (AIS_InteractiveContext) for a long time. The concept of Local Context is quite simple and powerful - differentiation of two Viewer states: Neutral Point where all model objects reside, and Local Context augmenting main model presentations with a

0 replies1 file

Weighted Blended Order-independent transparency

Open CASCADE Technology 7.2.0 introduces a new feature in OCCT 3D Viewer for handling translucent presentations Weighted Blended Order-Independent Transparency (OIT) , #0027925. Archived image: external image Archived image: external image break Apart from the new algorithm itself, the improvement s

0 replies2 files

DirectX Interop support for DirectX11

Is there any plan for support rendering with DirectX11 using WGL_NV_DX_interop2? It will be very useful to have even the version for DirectX11 plus the actual DirectX9 version.

1 reply

How to get the total GPU memory size?

When starting our OCC-based application with an older graphics card (Nvidia Quadro FX 1700 with 500 MB GPU memory) a user received an error message that the application requested more GPU memory than is available. When checking we realized that the main reason for the hight GPU memory consumption is

4 replies

GLSL to become the main rendering path in OCCT

In the past, graphic card in computer was designed to perform limited set of operations. At some point, all cards had to provide the hardware-accelerated functionality called Transformation and Lighting (T&L). Application developers had to implement all features and visual effects that were not part

0 replies

Visualization of the model cross-section using OpenGL

Clipping visualized 3D models with user-defined clipping planes is one of basic OpenGL features that allows the user to look inside the models. However, in some cases it is more interesting to investigate the cross-section shape rather than the model's internals. For this purpose, the cross-section

5 replies1 file

Overpainting a view

Hi, I've been working on an example [1] where I'm using (Python)OCC ( still on 6.8.0 ) and (Py)Qt4 to overpaint a V3d_View. The objective here is to be able to embed Qt widgets in the opengl view. I've had a 1st success: I'm able to use QPainter to overpaint the V3d_View, huzzzaaah ;) Now, this woul

6 replies

Redesigned selection in OCCT 6.9.0

One of the most breaking changes in visualization component in OCCT 6.9.0 is complete reconsideration of selection mechanism. The new algorithm is designed to improve performance of dynamic selection of complex scenes by using effective 3D acceleration structures which are built only once and are au

2 replies12 files

AIS_InteractiveContext::Display is slow in 6.9.0 beta

I've tested occt 6.9.0 beta and noticed that displaying AIS_IO now requires more time than earlier. Investigating this I detected that AIS_InteractiveContext::Display spends 95% of time to add AIS_IO to selection manager, 75% of which is spent to find element in NCollection_BaseSequence. NCollection

6 replies

Immediate mode in OCCT 3D Viewer

OCCT 3D viewer provides the way for rendering temporary presentations without redrawing previously drawn content. This feature is designed to optimize viewer performance when only small part of the scene is changed dynamically, usually providing some feedback for user actions. Archived image: Dynami

0 replies3 files

Shader support in OCCT 6.7.0

As implementation of one of the strategic steps in OCCT visualization component development road-map, support for GLSL shader programs has been added in Open CASCADE Technology 6.7.0. Archived image: external image Archived image: external image Shader programs have become a part of aspect classes i

8 replies6 files

Selection convert to 2D not very Efficient

Hi OCC Visualization Team, I found that the selection in OCC is in 2D graphic space, so when switch selection mode or change the view camera, the AIS_Shape will use void StdSelect_ViewerSelector3d::Convert (const Handle(SelectMgr_Selection)& theSel) to convert the object world coordinate from 3d to

10 replies

Back-face culling and Solid shapes

In some cases when a rendered closed shell consists of faces with different colors, visual artifacts at the edge of faces appearing at a certain view angle (Fig. 1). Archived image: external image Fig. 1. The visual artifacts on a simple cube The back-face culling mechanism allows removing these art

0 replies4 files

Review of the workflow of AIS_InteractiveContext

The attached materials review a drawback of the current visualization workflow which has to block the app GUI thread and thus decreases GUI responsiveness. Performance data have been collected to estimate potential gain of the improved workflow. The materials are based on discussions with Open CASCA

8 replies1 file

Regression on AIS_InteractiveConnect and AIS_MultipleConnected support in 6.8.0

Version 6.8.0 apparently introduced some significant change about how the IO's can be connected. The former use case as explained in my blog post ( http://opencascade.blogspot.ru/2013/11/ais-connecting-objects.html ) has been broken. In particular an exception is currently thrown in ConnectedInterac

7 replies

Removing underlayer from Visual3d_View

We are very likely to consider 2D layer (API for drawing 2D objects over the 3D scene) design improvement as one of further improvements of OCCT visualization. Removing "underlayer" and keeping only one 2D layer ("overlayer") would simplify this work to a certain extent. Our feeling is that many peo

2 replies

Cocoa_Window and retina support

Hi, I've noticed that the Cocoa_Window does not support retina / Hi-DPI screen ( like you find on a mac book pro or an android or iOS device ). Cocoa is conservative and won't go into retina mode, unless NSView's setViewWantsBestResolutionOpenGLSurface( true) method is called. There is a pretty dece

3 replies

Ray tracing progress: support for lines, markers and text added

Few months ago, the OCCT ray tracing algorithm was rewritten using GLSL. Apart from better portability and certain performance gain, this step opened the door to some important features that can be added most naturally using close OpenGL and GLSL interoperation - such as visualization of lines and t

3 replies3 files

Ray tracing as alternative rendering method for OCCT visualization component

OCCT 6.7.0 introduces several major improvements of the visualization component. One of the most breaking changes in OCCT visualization concerns simplified implementation of ray tracing algorithm for regular OCCT visualization primitives . This algorithm is implemented using OpenCL. Being a part of

22 replies5 files

DirectX support

Is there any plan to support even the DirectX Visualization? Developing another dll for rendering such as TKDirectX instead of only TKOpenGL? I need to integrate the OpenCascade view into WPF application, as with DirectX and Direct3D rendering it is possible to avoid the airpsace issue, I'd like to

25 replies

Visualization future works

I have seen the roadmap for the future works in visualization project, but I haven't understood right the points: - Improvement of "immediate mode" behavior - OpenGL-based rubber band to replace the application-level implementations based on windows system API. Can you explain them with more details

1 reply

Graphics driver problems

What we observed in our work with OCCT and graphics drivers (NVIDIA mostly) is that the application behaves differently depending on the settings/profile we use. For example, until recently I had had a driver from December 2012 for my Quadro 1000M. In an OCCT application, which performs motion simul

5 replies