PolygonToSpline.js dedicated thread

PolygonToSpline.js dedicated thread

This is such a useful script it deserves its own tutorial thread. Hiroto originally posted the Polygon2Spline script, then replaced it with the current more powerful PolygonToSpline. Ideally, this thread will serve as a central archive of new posts and links to older posts to help all C3D users, from beginners to experts. It should be possible to read through the whole thread in 15 minutes and immediately start using the script. There are many settings I don't get — margin, wave, etc. Please add tutorials that explain how they work.

A simple example of using the script to make Path splines for a Sweep object, using either all the edges or just the selected vertical edges:
http://www.cheetah3d.com/forum/showpost.php?p=99760&postcount=12

More complex examples:
http://www.cheetah3d.com/forum/showthread.php?t=11871

Hiroto's download link:
http://www.tres-graficos.jp/blog/files/article.php?id=109

Expand the script and place it into into the Splines folder
OS X 10.6: Hard drive/Users/your_name/Library/Application Support/Cheetah3D/Scripts/Splineobj
OS X El Capitan (may be hidden): http://www.cheetah3d.com/forum/showthread.php?t=11913

(Start C3D) Open the script from Tools/Script/Spline Script.

With the script selected in the Object Browser, drag the target polygon model into "Guide target" space.
http://www.cheetah3d.com/forum/showpost.php?p=102092&postcount=20

Note the choice of "create type." (I use "all edges" or "selected edge"— but I have questions about this — more about this in another post.) Collapse the script object to get the spline object. I usually change the spline type from Bezier to Linear if my splines are all straight anyway.

Tip #1: If you move/rotate/scale the target object, Burn the transform to get the splines in the same place where the target object is.
http://www.cheetah3d.com/forum/showpost.php?p=102095&postcount=21

So much for getting started. Following posts will discuss details.
 
PolygonToSpline script: Burn transform

If you move/rotate/scale the target object, Burn the transform to get the splines in the same place where the target object is.
 

Attachments

  • ptos_burn.jpg
    ptos_burn.jpg
    79.5 KB · Views: 604
PolygonToSpline script: Connect

The scalpel-cut edges were selected when the target Ball was dragged and dropped into the PolygonToSpline "guide target" space. The edge segments were also "connected."

After collapsing the PolygonToSpline object, all points on the resulting spline were Area Selected and the angular vertices converted into Bezier curves with Soft Interpolation. This was then used as a Path for the Sweep object on the right.
 

Attachments

  • ptos_connect.jpg
    ptos_connect.jpg
    188.9 KB · Views: 612
PolygonToSpline script: gap problem

How to avoid gaps at the vertices in a Sweep object? Any tips?

Left: PolygonToSpline "connect" is not checked; the Sweep has gaps.
Right: PolygonToSpline "connect" is checked; the Sweep has no gaps but is missing edges.
 

Attachments

  • connect_gap.jpg
    connect_gap.jpg
    198 KB · Views: 582

Splines have to be either a line or a loop, no intersections.
Since we're making splines from edges it's easy to forget.

Cheetah does pretty well even so.

 

Here's how I use the Wave function to make a wavy spline.

From that I can make a woven screen.

 

Attachments

  • wavy-spline.gif
    wavy-spline.gif
    267.1 KB · Views: 614
  • SoftWovenScreen.jpg
    SoftWovenScreen.jpg
    273.4 KB · Views: 586
Back
Top