Spline Stroke

Spline Stroke

MehdiZangenehBar
Advocate Advocate
1,205 Views
11 Replies
Message 1 of 12

Spline Stroke

MehdiZangenehBar
Advocate
Advocate

What is the correct way to create stroke along a path (spline)?
My goal is to create a modifer using scripted plugin that will accept a spline and ouput a (2d) geometry or shape. something like this:
Stroke.jpg 

0 Likes
1,206 Views
11 Replies
Replies (11)
Message 2 of 12

klvnk
Collaborator
Collaborator

what's wrong with the sweep modifier ?

0 Likes
Message 3 of 12

istan
Advisor
Advisor

how about spline thickness?

0 Likes
Message 4 of 12

MehdiZangenehBar
Advocate
Advocate

nothing, I just need to create from scratch to have full controll to add some more features, for example:

StartOffset.jpgEndOffset.jpgScatter.jpgSelectiveHide.jpgThickness Curve.jpg

 

And so much more, So I need to create my own.

0 Likes
Message 5 of 12

MehdiZangenehBar
Advocate
Advocate

I need more than that. I just mentioned the start point.

0 Likes
Message 6 of 12

klvnk
Collaborator
Collaborator

the third one and the last are probably best done as different modifiers the last is best done as a "rail" modifier ie 2 splines to describe the outline shape . the 4th is just a delete mesh mod on top of the mod ( or 3 seperate meshes 😕 )

 

the trick with these kinds modifiers in the sdk is to use the polyline (the visual representation extracted from the bezier) as the basis and not the actual bezier. Unfortunately to my knowledge this is not available in mxs (though you can approximate it). You then compute all the frenets (search the sdk and theres multiple versions)  (array of xforms) a basis xform  (computes the tolocal xform) as you can have more than one spline. There some really tricky maths for keeping a constant cross section (not included in the sdk versions 😐 )  and some post processing funkiness to make sure everything connects nicely in the case of a closed spline.

0 Likes
Message 7 of 12

denisT.MaxDoctor
Advisor
Advisor

The 2D version is very easy to implement in MXS. I would do it as SimpleObj - a spline is deforming a plane..... For a 2D spline, it is very easy to get a matrix in any curve parameter. This matrix should be used to transform the vertices of the "plane". A curve controls or Bézier controllers can give the scale and offset.
I remember a very similar plugin I showed in CGTalk.

I also remember a very good example of a plugin from Swordslayer on a similar theme.

0 Likes
Message 8 of 12

denisT.MaxDoctor
Advisor
Advisor

Another simple solution is to use the "Rendered" spline with the "Rectangular" option. Remove all unnecessary and tessellate what you need.

0 Likes
Message 9 of 12

MehdiZangenehBar
Advocate
Advocate

Yea, 2d version using simpleobj does the job I think, would please repost the sample here, sadly we don't have access to CGTalk archive anymore.

0 Likes
Message 10 of 12

MehdiZangenehBar
Advocate
Advocate

Yea, I need them all in one modifier, and yes I need a new shape or mesh at top of the spline.

0 Likes
Message 11 of 12

MehdiZangenehBar
Advocate
Advocate

C# version using Autodesk.max.dll also works for me.

0 Likes
Message 12 of 12

istan
Advisor
Advisor

I'd use simple splines and would create the mesh on my own - but C++ has "better" access to splines, imho.

0 Likes