4D v16

SVG_New_regular_polygon

Home

 
4D v16
SVG_New_regular_polygon

SVG_New_regular_polygon 


 

SVG_New_regular_polygon ( parentSVGObject ; width ; number {; x {; y {; foregroundColor {; backgroundColor {; strokeWidth}}}}} ) -> Funktionsergebnis 
Parameter Typ   Beschreibung
parentSVGObject  SVG_Ref in Reference of parent element
width  Lange Ganzzahl in Diameter of surrounding circle
number  Lange Ganzzahl in Number of sides
Lange Ganzzahl in Coordinate on center X axis
Lange Ganzzahl in Coordinate on center Y axis
foregroundColor  String in Color or gradient name
backgroundColor  String in Color or gradient name
strokeWidth  Zahl in Line thickness
Funktionsergebnis  SVG_Ref in Reference of polygon

The SVG_New_regular_polygon command draws a regular polygon with number of sides fit into a circle with a diameter of width in the SVG container designated by parentSVGObject and returns its reference. If parentSVGObject is not an SVG document, an error is generated.

The optional x and y parameters can be used to specify the center of the circle. If they are omitted, the figure will be drawn in the upper left corner of the document.

The optional foregroundColor and backgroundColor parameters contain, respectively, the name of the line color and of the background color. (For more information about colors, please refer to the commands of the Colors and Gradients theme).

The optional strokeWidth parameter contains the size of the pen expressed in pixels. Its default value is 1.

Draw a pentagon (default fill and border color, default line thickness):

 svgRef:=SVG_New
 objectRef:=SVG_New_regular_polygon(svgRef;100;5)

Draw an octogon, the circle containing it and the trace lines:

 svgRef:=SVG_New
 $width:=200
 $sides:=8
 objectRef:=SVG_New_regular_polygon(svgRef;$width;$sides;0;0;"crimson";"palevioletred";2)
 
 $radius:=$width/2
 objectRef:=SVG_New_rect(svgRef;0;0;$width;$width;0;0;"blue";"none")
 objectRef:=SVG_New_line(svgRef;0;$radius;$width;$radius;"blue")
 objectRef:=SVG_New_line(svgRef;$radius;0;$radius;$width;"blue")
 objectRef:=SVG_New_line(svgRef;0;0;$width;$width;"blue")
 objectRef:=SVG_New_line(svgRef;$width;0;0;$width;"blue")
 objectRef:=SVG_New_circle(svgRef;$radius;$radius;$radius;"blue";"none")



Siehe auch 

SVG_New_polygon

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Drawing
Nummer: 65974

 
GESCHICHTE 

Geändert: Composant 4D SVG v11.4

 
ARTIKELVERWENDUNG

4D SVG ( 4D v16)