# Arc morph?

8 messages
Open this post in threaded view
|

## Arc morph?

 I’m trying to find a nice way to do circular arc morphs; so far CurveMorph isn’t playing very nice for this and google is not finding anything that looks interesting. Has anyone seen suitable code, or is anyone in possession of the Seekrit Knowledge of how to make CurveMorph do clean circular arcs? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/timFor every action, there is an equal and opposite criticism.
Open this post in threaded view
|

## Re: Arc morph?

 Something like this, maybe? 'From Squeak5.1 of 23 August 2016 [latest update: #16548] on 3 April 2017 at 3:24:01 pm'! Morph subclass: #BobsArcMorph     instanceVariableNames: 'lineWidth startAngle stopAngle'     classVariableNames: ''     poolDictionaries: ''     category: 'MorphicExtras-AdditionalMorphs'! !BobsArcMorph methodsFor: 'as yet unclassified' stamp: 'raa 4/3/2017 15:22'! drawOn: aCanvas "  BobsArcMorph new openInWorld "     | center radius angle pt lw2 stop step |         aCanvas fillRectangle: self bounds color: Color gray.     lw2 _ lineWidth // 2.     center _ self bounds center - (lw2@lw2).     radius _ (self width min: self height) // 2 - lw2.     angle _ startAngle min: stopAngle.     stop _ (startAngle max: stopAngle) min: angle + Float twoPi.     step _ 0.9 / radius.     [         pt _ center + (Point r: radius degrees: angle radiansToDegrees) rounded.         aCanvas fillRectangle: (pt extent: lineWidth@lineWidth) color: color.         angle _ angle + step.         angle > stop     ] whileFalse! ! !BobsArcMorph methodsFor: 'as yet unclassified' stamp: 'raa 4/3/2017 15:23'! initialize     super initialize.     lineWidth _ 2.     startAngle _ 0.     stopAngle _ Float pi * 1.3.     self color: Color yellow.     self extent: 200@200.! ! On 4/3/17 2:23 PM, tim Rowledge wrote: ```I’m trying to find a nice way to do circular arc morphs; so far CurveMorph isn’t playing very nice for this and google is not finding anything that looks interesting. Has anyone seen suitable code, or is anyone in possession of the Seekrit Knowledge of how to make CurveMorph do clean circular arcs? tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim For every action, there is an equal and opposite criticism. ```
Open this post in threaded view
|

## Re: Arc morph?

 > On 03-04-2017, at 12:25 PM, Bob Arning <[hidden email]> wrote: > > Something like this, maybe? Yeah, that’s an interesting start. I also found -http://wiki.squeak.org/squeak/uploads/2624/PieChartMorph-gm.cs which is ancient and I’m afraid  I have no idea who ‘gm’ might be. That uses the low level polygon drawing on Canvas methods. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/timAny nitwit can understand computers.  Many do.
Open this post in threaded view
|

## Re: Arc morph?

 On 4/3/17 3:37 PM, tim Rowledge wrote: `I have no idea who ‘gm’ might be.`
Open this post in threaded view
|

## Re: Arc morph?

 In reply to this post by timrowledge gm is for German Morales Ken G. BrownOn Apr 3, 2017, at 13:37, tim Rowledge <[hidden email]> wrote:On 03-04-2017, at 12:25 PM, Bob Arning <[hidden email]> wrote:Something like this, maybe?Yeah, that’s an interesting start. I also found -http://wiki.squeak.org/squeak/uploads/2624/PieChartMorph-gm.cs which is ancient and I’m afraid  I have no idea who ‘gm’ might be. That uses the low level polygon drawing on Canvas methods.tim--tim Rowledge; [hidden email]; http://www.rowledge.org/timAny nitwit can understand computers.  Many do.
Open this post in threaded view
|

## Re: Arc morph?

 Etoys image has a SectorMorph Not sure if it is in trunkBest,Karl On Mon, Apr 3, 2017 at 10:22 PM, Ken Brown wrote:gm is for German Morales Ken G. BrownOn Apr 3, 2017, at 13:37, tim Rowledge <[hidden email]> wrote:On 03-04-2017, at 12:25 PM, Bob Arning <[hidden email]> wrote:Something like this, maybe?Yeah, that’s an interesting start. I also found -http://wiki.squeak.org/squeak/uploads/2624/PieChartMorph-gm.cs which is ancient and I’m afraid  I have no idea who ‘gm’ might be. That uses the low level polygon drawing on Canvas methods.tim--tim Rowledge; [hidden email]; http://www.rowledge.org/timAny nitwit can understand computers.  Many do.