[Newbies] Drawing an Arc.
Hilaire Fernandes
hilaire at ext.cri74.org
Sun Jul 9 13:05:00 UTC 2006
Ooooops.
Edit with a random text editor the change set and make its super class
to PolygonMorph.
Once file-in, add an initialize method to DrGArcMorph with
initialize
super initialize
self makeOpen
Hilaire
Claudio Acciaresi a écrit :
> Thanks a lot for your answer, I file in what you sent me, but DrGArcMorph
> is subclass of DrGPolylineMorph and i do not have this last class.
> Can i install it with SqueakMap?
>
> Claudio.
> ----- Original Message -----
> From: "Hilaire Fernandes" <hilaire at ext.cri74.org>
> To: "A friendly place to get answers to even the most basic questions
> aboutSqueak." <beginners at lists.squeakfoundation.org>
> Sent: Sunday, July 09, 2006 12:27 PM
> Subject: Re: [Newbies] Drawing an Arc.
>
>
>> Hello Claudio,
>>
>>
>> You may want to give a try to my simple DrGArcMorph in the enclosed
>> change set.
>>
>> To use it:
>>
>> a :=DrGArcMorph new
>> a center: 50 at 50 radius: 100 origin: 0 length: 3.1415
>> a openInWorld
>>
>> origin and length are in radian unit
>>
>> Hilaire
>>
>> Claudio Acciaresi a écrit :
>>> Hello, I`m trying to draw an arc using Morphs, exists an easy way to do
>>> it?
>>> The acrs that i´m trying to create are like smiles of a face.
>>> I see FaceMorph, Gesture morph, but i do not want to use a
> PolygonMorph.
>>> Thanks a lot!!!!
>>> Claudio.
>
>
> ----------------------------------------------------------------------------
> ----
>
>
>> 'From Squeak3.8 of ''5 May 2005'' [latest update: #6665] on 9 July 2006 at
> 12:23:31 pm'!
>> DrGPolylineMorph subclass: #DrGArcMorph
>> instanceVariableNames: ''
>> classVariableNames: ''
>> poolDictionaries: ''
>> category: 'DrGeoII-GeometryView'!
>>
>> !DrGArcMorph methodsFor: 'accessing' stamp: 'HilaireFernandes 1/17/2006
> 12:29'!
>> center: aPoint radius: aFloat origin: anOrigin length: aLength
>> |step costep sinstep csteX csteY mobile|
>> step := 5 / aFloat * aLength sign.
>> (aLength / step) abs > 100 ifTrue: [step := aLength / 100].
>> costep := step cos.
>> sinstep := step sin.
>> csteX := aPoint x * (1 - costep) + (aPoint y * sinstep).
>> csteY := aPoint y * (1 - costep) - (aPoint x * sinstep).
>> mobile := aPoint + (aFloat * (anOrigin cos @ anOrigin sin)).
>> vertices := OrderedCollection new add: mobile; yourself.
>> 0 to: (aLength / step) truncated -1 do: [:i|
>> mobile := (mobile x * costep - (mobile y * sinstep) + csteX)
>> @(mobile x * sinstep + (mobile y * costep) + csteY).
>> vertices add: mobile].
>> mobile := aPoint + (aFloat * ((anOrigin + aLength) cos @ (anOrigin +
> aLength) sin)).
>> vertices add: mobile.
>> self computeBounds! !
>>
>
>
> ----------------------------------------------------------------------------
> ----
>
>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>
>
>
>
>
> ___________________________________________________________
> 1GB gratis, Antivirus y Antispam
> Correo Yahoo!, el mejor correo web del mundo
> http://correo.yahoo.com.ar
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
More information about the Beginners
mailing list