Jump to content

Extrude splines


Recommended Posts

:rolleyes: thx 4 the praise
Splines are intresting to create tweens (e.g.:moving cam) or build shapes to extrude.Define splines with vectors, nurbs or importing svg or font types (e.g. ttf). With three.js you can define a curve:

spline = new THREE.SplineCurve3([new THREE.Vector3(0, 0, 0),new THREE.Vector3(0, 200, 0),new THREE.Vector3(150, 150, 0),new THREE.Vector3(150, 50, 0),new THREE.Vector3(250, 100, 0),new THREE.Vector3(250, 300, 0)]);

An another clever way are formulas to create splines/meshes:

THREE.Curves = {};THREE.Curves.HeartCurve = THREE.Curve.create(function(s) {    this.scale = (s === undefined) ? 5 : s;},function(t) {    t *= 2 * Math.PI;    var tx = 16 * Math.pow(Math.sin(t), 3);    ty = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t), tz = 0;    return new THREE.Vector3(tx, ty, tz).multiplyScalar(this.scale);});

By this method you can do complex things with few lines of code.
You find more infos about splines and extrusion under the following links:



Formular demo on google


Decorative Knot Patterns




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...