Making a perfect curve

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
sicvolo
Posts: 8
Joined: Sat May 03, 2008 12:08 am

Making a perfect curve

Post by sicvolo »

Ever wanted to have a perfect curve in CFA? The one does not have gaps, smooth all around and done with with the minimal number of primitives?
Well here is my try at it. You can see it here.

Code: Select all

rule perfectCurve{
 boxRight {}
 perfectCurve { x (-.5+0.96/2*(cos(12)+sin(12))) y (.49+0.96/2*(cos(12)-sin(12))) r -12 s 0.96 z -1}
}
path boxRight {
   MOVETO {x -.5 y -.5}
   ARCTO {x -.5 y .5 r (1/sin(12)) p cw}
   LINETO{x .5 y .5}
   ARCTO{ x (-.5+1/0.96*cos(12)) y (-.5+1/0.96*sin(12)) r (1/sin(12)-1/0.96) }
   FILL {}
}
To use a different angle, change "12" in cos, sin and r arguments. To change the reduction rate change 0.96 everywhere in the code.

Hope you like it.

User avatar
askiopop
Posts: 12
Joined: Wed Mar 04, 2009 7:07 pm
Location: Guess

Post by askiopop »

Do you have a starshape?
thank you

Post Reply