How to draw the 3D screw like the flowing picture show? I need some suggestion.
I am assuming you wanted to draw Screw thread. If so there are extrusion filters that may help you like the vtkRotationExtrusionFilter. There is one example available right now where they have provided example for a spring: https://examples.vtk.org/site/Cxx/Modelling/Spring/
In our projects we always get the 3D model of the screw from the manufacturer, 3D model repository, or design it in a CAD software. This is less work than developing an algorithm that can generate an entire screw at any size (and screws come in specific sizes anyway).
If you want to generate arbitrary screw sizes at runtime using VTK then you may be able to do it by applying scaling transform to a screw of similar size and/or cutting and assembling the screw from pieces.
If you really want to develop a screw generator algorithm then you can have a look at OpenSCAD scripts.
The vtkRotationalExtrusionFilter can be used to create a basic screw. But as Andras mentions, if you want something more sophisticated a CAD modeling system is the way to go.
Hi,
In addition to the suggestions above, you can use Blender 3D, which is a very powerful general-purpose 3D modeling software that is also free to use. Blender has the so-called mesh modifiers which you can stack to produce very complex periodic shapes like that of a screw:
The example above took me a few minutes to make by stacking a screw and a scaler mesh modifiers to achieve a shape similiar to your example. Once you’re happy, just export it to, say, OBJ format which is readable by VTK.
regards,
PC
tks!