🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20204

Re: Question about polygons

#20204
From: Olav Kvern
Date: Mon, 05 Aug 2002 19:35
33 lines
1987 bytes
Reinhard-- 

Here's an a subroutine for drawing regular star polygons. 

Private Sub myDrawStarPolygon(myRadius, myInsetPercentage, myNumberOfSides, myXCenter, myYCenter, myPage) 
Dim myAngle As Double 
myAngleIncrement = (360 / myNumberOfSides) / 2 
myInnerRadius = myRadius * (myInsetPercentage * 0.01) 
Set myPolygon = myPage.Lines.Add 
Set myPath = myPolygon.Paths.Item(1) 
For myCounter = 1 To (myNumberOfSides * 2) 
����If myCounter <= 2 Then 
��������Set myPathPoint = myPath.PathPoints.Item(myCounter) 
����Else 
��������Set myPathPoint = myPath.PathPoints.Add 
����End If 
����myAngle = myAngleIncrement * (myCounter - 1) 
����If (myCounter Mod 2) <> 0 Then 
��������myX = myXCenter + (myCosine(myAngle) * myRadius) 
��������myY = myYCenter - (mySine(myAngle) * myRadius) 
����Else 
��������myX = myXCenter + (myCosine(myAngle) * myInnerRadius) 
��������myY = myYCenter - (mySine(myAngle) * myInnerRadius) 
����End If 
����myPathPoint.Anchor = Array(myX, myY) 
Next 
myPath.PathType = idClosed 
End Sub 
 

Thanks, 

Ole
Technical Details
Message-ID: <efa02f9.1@WebX.aaQKaf7vad4>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!bnewspeer01.bru.ops.eu.uu.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <efa02f9.-1@WebX.aaQKaf7vad4>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f939a,326e7b55e86de689
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-08-05 12:41:17 PST
From: "Olav Kvern" <okvern@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!newsfeed.gamma.ru!Gamma.RU!news.maxwell.syr.edu!bnewspeer01.bru.ops.eu.uu.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Question about polygons
Message-ID: <efa02f9.1@WebX.aaQKaf7vad4>
Date: Mon, 5 Aug 2002 12:35:59 -0700
References: <efa02f9.-1@WebX.aaQKaf7vad4>
Lines: 34
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit