CAD CASE - Move with VTK and OPEN CASCADE
Welcome back, dear readers, to the eagerly awaited second issue of our CAD CASE Newsletter! ???? I am thrilled to have you on board as we continue our journey through the fascinating realms of Visualization Toolkit (VTK) and Open Cascade. In this edition, I have prepared an array of captivating content that will take you even deeper into the world of cutting-edge technology, mind-blowing simulations, and the boundless possibilities that await us in the realm of computer graphics and engineering simulations. So, fasten your seatbelts and get ready for a thrilling ride through the latest innovations, expert insights, and engaging tutorials that are sure to leave you inspired and motivated to explore the limitless potential of VTK and Open Cascade! Let's dive in and unlock the power of these incredible tools together. ??????
Content
VTK
Open CASCADE
C++
Let's dig in!
VTK Topic 1 :
VTK for dummies
VTK, short for the Visualization Toolkit, is a powerful and versatile open-source software library designed for the visualization and 3D modelling of scientific data. It was originally developed by Kitware Inc. and is widely used in various fields, including scientific research, engineering, medical imaging, and computer graphics.
The primary goal of VTK is to provide researchers, developers, and scientists with a comprehensive set of tools and algorithms to visualize complex data in a clear and intuitive manner. It offers a wide range of visualization techniques, enabling users to represent data in 3D space, explore it from different perspectives, and gain valuable insights from the visual representation.
Key features
If you are interested in this can follow the full article. Read more >>>>
VTK Topic 2 :
VTK - Dynamic Memory Allocation
vtkNew
vtkNew?is a macro provided by VTK to create objects on the stack (automatic storage) instead of using dynamic memory allocation. It simplifies memory management and ensures that the objects are automatically deleted when they go out of scope, avoiding memory leaks.?vtkNew?is typically used for creating objects with local scope within functions or limited contexts.
vtkSmartPointer
vtkSmartPointer?is a smart pointer class in VTK that provides automatic memory management for VTK objects on the heap (dynamic storage). It uses reference counting to keep track of how many smart pointers point to a particular object, and when the last smart pointer goes out of scope or is explicitly set to null, the associated object is deleted.?vtkSmartPointer?allows you to manage VTK objects' lifetimes dynamically, and they can be shared across different parts of your code.
If you are interested in this can follow the full article. Read more >>>>
VTK Topic 3 :
Interaction styles in VTK
Interaction styles in VTK define how users can interact with 3D scenes and manipulate objects. These interaction styles determine how the user's input through devices like a mouse or keyboard is translated into changes in the scene. This article will explore two fundamental VTK interaction styles:?Position Sensitive (Joystick Mode)?and?Motion Sensitive (Trackball Mode). We will delve into their functionalities, and applications, and compare their respective advantages and disadvantages.
Position-Sensitive interaction style
Position Sensitive interaction style, commonly known as Joystick Mode, derives its name from the analogy of using a joystick to navigate a scene. In this style, the 3D interaction depends on the mouse pointer's position or the device being used. When the mouse pointer is inside the 3D render window, moving the mouse while holding the designated button simulates rotation, translation, and scaling of the scene objects.
领英推荐
Motion Sensitive (Trackball Mode)
Motion Sensitive interaction style, often referred to as Trackball Mode, is based on the idea of moving an object on a virtual trackball around its canter to achieve different transformations. In this style, users can rotate the scene by dragging the mouse in any direction, translate by dragging it outside the object, and zoom in/out by using the mouse scroll wheel.
If you are interested in this can follow the full article. Read more >>>>
VTK Topic 4:
Lighting an object
Lighting in the real world is extremely complicated and there are many factors that determine them. These lighting models are based on the physics of lighting.
There are three major phrases when we trying to discuss about lighting.
Ambient Colour
The base colour is emitted uniformly in all directions by the surface. It models ambient lighting and provides minimum visibility for objects.
Diffuse Colour
The primary colour varies with the lighting direction. Brighter when facing lights and darker at oblique angles. Used to model matte, dull surfaces.
Specular colour
The highlight colour creates bright shiny spots on the surface. Varies strongly with the view angle. Used to model glossy, reflective surfaces.
If you are interested in this can follow the full article. Read more >>>>
Open CASCADE Topic 1 :
Intersection of ISO curve and boundary of TopoDS_Face
I found a question related to Open CASCADE in the?Stack Overflow. The question is as follows.
I?want to calculate the intersections of an u direction iso curve and the boundary of TopoDS_Face in occt,but i don't know how to write the code,anyone who can give some advices or sample code with c++?
I suppose the user wants to find the intersection of a TopoDS_Face and generated ISO curve. So here is my answer.
If you are a newbie you may or may not be familiar with ISO curves. But I suppose you know about that. I'll create a separate article on ISO curves later.
If you are interested in this can follow the full article. Read more >>>>
C++ Topic 2 :
Do You Know "Object Slicing"?
When you try to copy a subclass object to a superclass object, the superclass object does not have any member variables and member functions in the subclass. Therefore these variables and functions have been “sliced off”.
For example, let’s assume the class hierarchy is something like this.
Then, if you assign “B” object to “A”, you will lose all the attributes of “B”.
If you are interested in this can follow the full article. Read more >>