Tapered Bezier!

User avatar
Midgardsormr
Fusionator
Posts: 1089
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 2
Location: Los Angeles, CA, USA
Been thanked: 74 times
Contact:

Tapered Bezier!

#1

Post by Midgardsormr » Tue Aug 20, 2019 8:09 am

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.

You do not have the required permissions to view the files attached to this post.
Last edited by Midgardsormr on Thu Sep 12, 2019 3:32 pm, edited 3 times in total.

User avatar
SirEdric
Fusionator
Posts: 1862
Joined: Tue Aug 05, 2014 10:04 am
Answers: 2
Real name: Eric Westphal
Been thanked: 111 times
Contact:

Re: Tapered Bezier!

#2

Post by SirEdric » Tue Aug 20, 2019 8:34 am

NICE!!!

User avatar
AndrewHazelden
Fusionator
Posts: 1309
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 2
Location: West Dover, Nova Scotia, Canada
Been thanked: 38 times
Contact:

Re: Tapered Bezier!

#3

Post by AndrewHazelden » Tue Aug 20, 2019 11:01 am

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?

User avatar
Midgardsormr
Fusionator
Posts: 1089
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 2
Location: Los Angeles, CA, USA
Been thanked: 74 times
Contact:

Re: Tapered Bezier!

#4

Post by Midgardsormr » Tue Aug 20, 2019 11:16 am

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.

User avatar
French_Fry
Fusionista
Posts: 326
Joined: Tue Aug 05, 2014 8:04 am
Location: Nashville, TN
Contact:

Re: Tapered Bezier!

#5

Post by French_Fry » Wed Aug 21, 2019 5:25 am

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!

User avatar
Dunn
Moderator
Posts: 477
Joined: Mon Aug 04, 2014 4:27 am
Location: Hamburg, Germany
Been thanked: 2 times
Contact:

Re: Tapered Bezier!

#6

Post by Dunn » Wed Aug 21, 2019 7:26 am

Nice one Bryan! :buttrock:

ps. thanks for the shout out ;-)

User avatar
Midgardsormr
Fusionator
Posts: 1089
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 2
Location: Los Angeles, CA, USA
Been thanked: 74 times
Contact:

Re: Tapered Bezier!

#7

Post by Midgardsormr » Thu Sep 12, 2019 3:40 pm

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.