Page 1 of 1

Tapered Bezier!

Posted: Tue Aug 20, 2019 8:09 am
by Midgardsormr
Bezier_00_cover-1.jpg
http://www.bryanray.name/wordpress/tape ... or-fusion/


Two things have been bugging me for a while: BezierTo() is broken*, and Fusion can't draw a tapered curve. So I am fixing both of those things. First step toward that goal is this tapered Bezier curve Fuse.

I'm hoping today to be able to break open the Shape metatable and replace the BezierTo() method. That one won't be able to taper, though, because the technique I'm using breaks the line styling. Once I've done that, I'd love to make a new Lightning Fuse with curved segments and better directionality to the forks.

*Turns out BezierTo() isn't broken; it was just poorly documented. The taper complaint remains, though.
An update: I've extended the tapered Bezier to Lines, Ellipses, and Rectangles. The fuse is now MT_TaperedShapes. I wanted to do PolyLines, but there's currently no way to get the data from a PolyLine control into the Fuse itself.

Re: Tapered Bezier!

Posted: Tue Aug 20, 2019 8:34 am
by SirEdric
NICE!!!

Re: Tapered Bezier!

Posted: Tue Aug 20, 2019 11:01 am
by AndrewHazelden
Neat stuff @Midgardsormr! :)

I like the use of self:BeginControlNest() and self:EndControlNest() for the UI. I should start using that approach too.

Reading the fuse header comments, was the creation date for version 0.4 of this fuse really two years ago on Aug 19, 2017?

Re: Tapered Bezier!

Posted: Tue Aug 20, 2019 11:16 am
by Midgardsormr
AndrewHazelden wrote: Tue Aug 20, 2019 11:01 am I like the use of self:BeginControlNest() and self:EndControlNest() for the UI.

Reading the fuse header comments, was the creation date for version 0.4 of this fuse really two years ago on Aug 19, 2017?
:D The ControlNest actually came in when I stole the Create function from the Lines Fuse. Synchronicity. But it amused me as soon as I saw it!

Version 0.2 of the previous Fuse was dated Aug 16, 2017. Guess I forgot to change the year... Fixed now.

Re: Tapered Bezier!

Posted: Wed Aug 21, 2019 5:25 am
by French_Fry
Very cool tool Bryan! Kind hard to fathom that something like this needs to be written as a third-party tool ( as opposed to a standard out of the box option), but it looks great and I can see how this may be the first step towards something way more powerful! Good job!

Re: Tapered Bezier!

Posted: Wed Aug 21, 2019 7:26 am
by Dunn
Nice one Bryan! :buttrock:

ps. thanks for the shout out ;-)

Re: Tapered Bezier!

Posted: Thu Sep 12, 2019 3:40 pm
by Midgardsormr
Update! I've extended the approach used to create the TaperedBezier to Lines, Ellipses and Rectangles. I have accordingly replaced the file in the first post of the thread. The Rectangle code is a little wonky, but it was the only way I could think of to treat it as a continuous shape for the purposes of the taper and the write-on feature.

The next thing I'd like to do is add a Gradient control so the color can ramp across the shape.