2
$\begingroup$

I know the command Circle can do that too, however, I want to be more flexible later on and want to know how to define this with the above mentioned functions. Thanks in advance!

$\endgroup$
  • 1
    $\begingroup$ Why not use something like this? Graphics[{Black, Thickness[.1], CapForm["Round"], Circle[{0, 0}, ArmRadius + WireRadius, {0, -90 Degree}]}] If you only want one end to be round, you can make two halves, one of which has CapForm["Butt"]. $\endgroup$ – Jens Mar 21 '16 at 20:48
  • $\begingroup$ This solution does not offer complex shaped designs... My example just serves as a guide. Being completly flexible seems to work only with BezierCurve or BSplineCurve(as I imagine). However, I completly failed trying any solution on that basis. $\endgroup$ – Kay Mar 21 '16 at 21:00
  • 1
    $\begingroup$ I think you'll have to explain what more complex shape designs you are looking for, otherwise the answer may end up being too narrow for your purpose. $\endgroup$ – Jens Mar 21 '16 at 21:16
  • $\begingroup$ true, got the point! However, I think it would help, if I know, how to define a quarter of a circle by BSplineCurve. As far as I understood BezierCurve is just able to approximate a quarter of a circle. where BSplineCurvecan treat that exact. Is that true? $\endgroup$ – Kay Mar 22 '16 at 12:44
  • $\begingroup$ Some info on how to construct a circle with rational splines: en.wikipedia.org/wiki/… $\endgroup$ – shrx Mar 22 '16 at 13:19
5
$\begingroup$

This will give a quarter of a circle,

Graphics[BSplineCurve[{{1, 0}, {1, 1}, {0, 1}},
  SplineWeights -> {1, Sqrt[2]/2, 1},
  SplineKnots -> {0, 0, 0, 1, 1, 2}]
 ]

enter image description here

and this gives the whole circle,

Graphics[BSplineCurve[{{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 
    0}, {-1, -1}, {0, -1}, {1, -1}, {1, 0}},
  SplineWeights -> {1, Sqrt[2]/2, 1, Sqrt[2]/2, 1, Sqrt[2]/2, 1, 
    Sqrt[2]/2, 1},
  SplineKnots -> {0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4}]]

enter image description here

I got the info to make these from a combination of this page and this page. This page looks very useful for digging into the theory behind it all.

$\endgroup$
  • $\begingroup$ I gave an expression for a general arc here. $\endgroup$ – J. M. is away Mar 22 '16 at 22:37
  • $\begingroup$ hmmmm, would you say this is a duplicate of that question? $\endgroup$ – Jason B. Mar 23 '16 at 8:40
  • $\begingroup$ I'm on the fence regarding this. $\endgroup$ – J. M. is away Mar 23 '16 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.