Ellipse¶
Overview¶
Class
An ellipse.
Supertypes
Attributes (data)
Name |
Multiplicity |
Type |
---|---|---|
1 |
||
1 |
||
1 |
||
1 |
||
1 |
||
1 |
Geometry¶
The geometry of an Ellipse is characterized by its Center, its two axes (HorizontalSemiAxis and VerticalSemiAxis), and the Rotation of the HorizontalSemiAxis w.r.t. the x axis of the owner. The Rotation is measured clockwise and in degrees.
Example
We consider an Ellipse with
Center
(10, 20)
,HorizontalSemiAxis
110
,VerticalSemiAxis
50
, andRotation
35
.
The Ellipse will look like this:
Visual Center
The visual center of an Ellipse is its actual Center.
Mapping to SVG¶
An Ellipse corresponds to an svg:ellipse with these attributes:
-
transform
describes both the Center \((c_x, c_y)\) and the Rotation \(r\) of the Ellipse.transform = "translate(
+ str(\(c_x\)) +,
+ str(\(c_y\)) +) rotate(
+ str(\(r\)) +)"
rx
andry
are string representations of HorizontalSemiAxis and VerticalSemiAxis.stroke
,stroke-dasharray
,stroke-dashoffset
andstroke-width
are set according to the SVG mapping rules for the Stroke of the Ellipse (see Stroke).stroke-linecap = "round"
andstroke-linejoin = "round"
reflect the heuristic for line caps and line joins.vector-effect = "non-scaling-stroke"
reflects the heuristic for scaled symbols.fill
is set according to the SVG mapping rules for the FillStyle of the Ellipse (see FillStyle).
Implementation in Proteus Schema
An Ellipse is implemented using the Proteus element
<Ellipse>
. An Ellipse whose
HorizontalSemiAxis equals its
VerticalSemiAxis may alternatively be implemented
using the Proteus element <Circle>>
.
Example
We assume that the Stroke of the Ellipse above is
2mm #ff0000 Solid
and that its FillStyle is
Transparent.
<svg
xmlns = "http://www.w3.org/2000/svg"
width = "192mm"
height = "154mm"
viewBox = "-86 -57 192 154">
<ellipse
transform = "translate(10,20) rotate(35.0)"
rx = "110"
ry = "50"
stroke = "#ff0000"
stroke-dasharray = "none"
stroke-dashoffset = "0mm"
stroke-width = "2mm"
stroke-linecap = "round"
stroke-linejoin = "round"
vector-effect = "non-scaling-stroke"
fill = "none"/>
</svg>
Implementation in Proteus Schema
<Ellipse PrimaryAxis = "110" SecondaryAxis = "50">
<Presentation
LineType = "0"
LineWeight = "2"
R = "1"
G = "0"
B = "0"/>
<Position>
<Location X = "10" Y = "-20" Z = "0"/>
<Axis X = "0" Y = "0" Z = "1"/>
<Reference X = "0.819152044" Y = "-0.573576436" Z = "0"/>
</Position>
</Ellipse>
Example
We consider the same Ellipse as in the previous example,
except that the Stroke is
2mm #ff0000 LongDashShortDash
.
<svg
xmlns = "http://www.w3.org/2000/svg"
width = "192mm"
height = "154mm"
viewBox = "-86 -57 192 154">
<ellipse
transform = "translate(10,20) rotate(35.0)"
rx = "110"
ry = "50"
stroke = "#ff0000"
stroke-dasharray = "22mm 26mm 4mm 26mm"
stroke-dashoffset = "0mm"
stroke-width = "2mm"
stroke-linecap = "round"
stroke-linejoin = "round"
vector-effect = "non-scaling-stroke"
fill = "none"/>
</svg>
Implementation in Proteus Schema
<Ellipse PrimaryAxis = "110" SecondaryAxis = "50">
<Presentation
LineType = "4"
LineWeight = "2"
R = "1"
G = "0"
B = "0"/>
<Position>
<Location X = "10" Y = "-20" Z = "0"/>
<Axis X = "0" Y = "0" Z = "1"/>
<Reference X = "0.819152044" Y = "-0.573576436" Z = "0"/>
</Position>
</Ellipse>
Example
Finally, a variant with Stroke 2mm #ff0000 Solid
and FillStyle Hatch.
<svg
xmlns = "http://www.w3.org/2000/svg"
width = "192mm"
height = "154mm"
viewBox = "-86 -57 192 154">
<defs>
<pattern
id = "pattern-1"
width = "10"
height = "20"
patternUnits = "userSpaceOnUse"
patternTransform = "rotate(-35.0) scale(1.0,1.0) rotate(315) translate(-1.0,-1.0)">
<polyline
points = "0,1.0 10,1.0"
stroke = "#ff0000"
stroke-width = "2mm"
vector-effect = "non-scaling-stroke"/>
</pattern>
</defs>
<ellipse
transform = "translate(10,20) rotate(35.0)"
rx = "110"
ry = "50"
stroke = "#ff0000"
stroke-dasharray = "none"
stroke-dashoffset = "0mm"
stroke-width = "2mm"
stroke-linecap = "round"
stroke-linejoin = "round"
vector-effect = "non-scaling-stroke"
fill = "url(#pattern-1)"/>
</svg>
Implementation in Proteus Schema
<Ellipse PrimaryAxis = "110" SecondaryAxis = "50" Filled = "Hatch">
<Presentation
LineType = "0"
LineWeight = "2"
R = "1"
G = "0"
B = "0"/>
<Position>
<Location X = "10" Y = "-20" Z = "0"/>
<Axis X = "0" Y = "0" Z = "1"/>
<Reference X = "0.819152044" Y = "-0.573576436" Z = "0"/>
</Position>
</Ellipse>
Center¶
Attribute (data)
The center position of the Ellipse.
Multiplicity: 1
Type: Point
FillStyle¶
Attribute (data)
The fill style of the Ellipse.
Multiplicity: 1
Type: FillStyle
HorizontalSemiAxis¶
Attribute (data)
The length of the horizontal semi-axis of the Ellipse in mm.
Multiplicity: 1
Type: Double
Rotation¶
Attribute (data)
The rotation of the Ellipse around its center, measured clockwise and in degrees. The value must be in the inverval [0; 360).
Multiplicity: 1
Type: Double
Stroke¶
Attribute (data)
The stroke of the Ellipse.
Multiplicity: 1
Type: Stroke
VerticalSemiAxis¶
Attribute (data)
The length of the vertical semi-axis of the Ellipse in mm.
Multiplicity: 1
Type: Double