# How to draw a 3D screw using VTK?

**URL:** https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238
**Category:** Support
**Tags:** jobs, code, proposal
**Created:** [September 4, 2023, 6:00am UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238 "2023-09-04T06:00:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.vtk.org/user_avatar/discourse.vtk.org/wulicheng/32/1990_2.png) [@wulicheng](https://discourse.vtk.org/u/wulicheng)
#### Post date: [September 4, 2023, 6:00am UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238/1 "2023-09-04T06:00:31Z")

</div>

How to draw the 3D screw like the flowing picture show? I need some suggestion.

 ![d606edee08bebe26049d5397a0ee101e](https://discourse.vtk.org/uploads/default/original/2X/5/57dbfc7d0b4e1822345306f9661020cadfacfbe0.jpeg)  
 ![76db1fc8a4f789fff23f03b13ecfe61b](https://discourse.vtk.org/uploads/default/original/2X/d/dae012832240cecb6e20464e2c9b86959ad89b38.jpeg)

---

<div class="post-metadata">

### Author: ![Sai\_Chaitanya\_Rodda](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sai_chaitanya_rodda/32/7139_2.png) [@Sai\_Chaitanya\_Rodda](https://discourse.vtk.org/u/Sai_Chaitanya_Rodda)
#### Post date: [September 5, 2023, 8:58am UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238/2 "2023-09-05T08:58:45Z")

</div>

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/](https://examples.vtk.org/site/Cxx/Modelling/Spring/)

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [September 5, 2023, 11:06am UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238/3 "2023-09-05T11:06:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![will.schroeder](https://discourse.vtk.org/user_avatar/discourse.vtk.org/will.schroeder/32/233_2.png) [@will.schroeder](https://discourse.vtk.org/u/will.schroeder)
#### Post date: [September 5, 2023, 11:11am UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238/4 "2023-09-05T11:11:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [September 5, 2023, 10:58pm UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238/5 "2023-09-05T22:58:30Z")

</div>

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:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/e/e94ae761c349f5dd51bcb91afd772dc78a1c981e.jpeg)

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

---

<div class="post-metadata">

### Author: ![wulicheng](https://discourse.vtk.org/user_avatar/discourse.vtk.org/wulicheng/32/1990_2.png) [@wulicheng](https://discourse.vtk.org/u/wulicheng)
#### Post date: [September 12, 2023, 6:00am UTC](https://discourse.vtk.org/t/how-to-draw-a-3d-screw-using-vtk/12238/6 "2023-09-12T06:00:37Z")

</div>

> [@Paulo\_Carvalho](#):
>
> Blender 3D

tks!
