Difference between revisions of "Hatch drawing definition"

From wiki.fine.cz
Jump to navigation Jump to search
m
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Used to store hatch definition.
Used to store hatch definition. Hatch contains serie (one or more) of fills. There are three types of fills - <code>StandardFill</code>, <code>LineFill</code>, <code>CompositeFill</code>.  


==== Data XML definition[edit | edit source] ====
'''Data XML definition'''
{| class="wikitable"
{| class="wikitable"
!Property
!Property
Line 8: Line 8:
!Default
!Default
|-
|-
|Hatch pattern
|Type
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Hatch</code>
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Type</code>
|Text identifier of Hatch pattern
|Type of hatch, possible values <code>StandardFill</code>, <code>LineFill</code> or <code>CompositeFill</code>
|(empty)
|(empty)
|}
=== '''StandardFill''' ===
----Area filled with solid color.
{| class="wikitable"
!Property
!XML
!Description
!Default
|-
|-
|Hatch color
|Color
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Color</code>
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Color</code>
|[[Colors|Color]] of the lines of the Hatch pattern
|[[Colors|Color]] of fill
|<code>clNone</code>
|<code>clDefault</code>
|}
'''Example of Data XML'''
 
<code><Fill Type="StandardFill" Color="clFill"></code>
 
=== '''LineFill''' ===
----Area filled with sequence of lines separated by distance. All lines are oriented in one direction.
{| class="wikitable"
!Property
!XML
!Description
!Default
|-
|Line direction
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Direction</code>
|Direction of line [rad]
|(empty)
|-
|Line origin
|<sup>[[Legend of XML elements|[E]]]</sup> <code>Origin</code>
|[[Point definition|Point]] defining origin of the line [mm]
|0, 0
|-
|-
|Background color
|Line distance
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Background</code>
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Distance</code>
|Background [[Colors|color]] used to fill area (<code>clNone</code> without fill, <code>clDefault</code> filled with color calculated from Hatch color by saturation)
|Distance of parallel lines [mm]
|<code>clDefault</code>
|(empty)
|-
|-
|Background saturation
|Line shift
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Saturation</code>
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Shift</code>
|Saturation of the background color for <code>clDefault</code>, range 10% to 90%
|Shift of next line (in direction of line) [mm]
|50
|(empty)
|-
|-
|Hatch definition
|Line definition
|<sup>[[Legend of XML elements|[E]]]</sup> <code>HatchDefinition</code>
|<sup>[[Legend of XML elements|[E]]]</sup> <code>Line</code>
|Definition of the [[Hatch drawing definition|hatch pattern drawing]], if ommited, hatch will be prepared using <code>Hatch</code> property
|Definition of the [[Line definition|line]], if there is more than 1 line definition, lines are drawn in sequence Line1->Distance->Line2->Distance->...->Line1->...
|(empty)
|(empty)
|-
|Color
|<sup>[[Legend of XML elements|[A]]]</sup> <code>Color</code>
|[[Colors|Color]] of fill
|<code>clDefault</code>
|}
|}
'''Example of Data XML'''
'''Example of Data XML'''


<code><Item ID="{331AD61E-8263-4C60-B19D-B937B125F1A6}" Hatch="GEO_GRANITE" Color="$00000000" Background="clDefault" Saturation="50"></code>
<code><Fill Direction="0" Distance="2" Shift="4"></code>
 
<code>  <Line Type="ElemLine"></code>
 
<code>    <Elem Kind="Line" DX="2" DY="0" /></code>
 
<code>    <Elem Kind="Move" DX="-1" DY="1" /></code>
 
<code>    <Elem Kind="Line" DX="0" DY="-2" /></code>
 
<code>    <Elem Kind="Move" DX="7" DY="0" /></code>
 
<code>  </Line></code>
 
<code></Fill></code>
 
=== '''CompositeFill''' ===
----This type is aggregate for drawing multiple fill in same area.
{| class="wikitable"
!Property
!XML
!Description
!Default
|-
|Fill
|<sup>[[Legend of XML elements|[E]]]</sup> <code>Fill</code>
|Definition of child hatch. May contain one or more fills.
|(empty)
|}
 
'''Example of Data XML - Multiple line hatch'''
 
<code><Fill Type="CompositeFill"></code>
 
<code>  <Fill Type="StandardFill" /></code>
 
<code>  <Fill Type="CompositeFill"></code>
 
<code>    <Fill Type="LineFill" Direction="0" Distance="9" Color="clFill"></code>
 
<code>      <Line Type="ElemLine"></code>
 
<code>        <Elem Kind="Move" DX="1.5" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="0" /></code>
 
<code>          <Pt X="-0.75" Y="1.25" /></code>
 
<code>          <Pt X="-0.75" Y="2.25" /></code>
 
<code>          <Pt X="-0.25" Y="2.5" /></code>
 
<code>          <Pt X="1.75" Y="2.25" /></code>
 
<code>          <Pt X="2" Y="1" /></code>
 
<code>          <Pt X="2.25" Y="0.75" /></code>
 
<code>          <Pt X="1.5" Y="0" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="3.75" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="0.25" /></code>
 
<code>          <Pt X="-0.25" Y="1.25" /></code>
 
<code>          <Pt X="0.5" Y="1.5" /></code>
 
<code>          <Pt X="0.75" Y="1.25" /></code>
 
<code>          <Pt X="0.75" Y="0.5" /></code>
 
<code>          <Pt X="0.5" Y="0.25" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="1.25" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="2" /></code>
 
<code>          <Pt X="0.25" Y="2.75" /></code>
 
<code>          <Pt X="1" Y="3" /></code>
 
<code>          <Pt X="1.75" Y="2.75" /></code>
 
<code>          <Pt X="2.25" Y="2" /></code>
 
<code>          <Pt X="2.25" Y="1.25" /></code>
 
<code>          <Pt X="1.5" Y="0.75" /></code>
 
<code>          <Pt X="1" Y="0.75" /></code>
 
<code>          <Pt X="0.25" Y="1.25" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="2.5" DY="0" /></code>
 
<code>      </Line></code>
 
<code>    </Fill></code>
 
<code>    <Fill Type="LineFill" Direction="0" Distance="9" Color="clFill"></code>
 
<code>      <Origin X="0" Y="3.25" /></code>
 
<code>      <Line Type="ElemLine"></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="0.25" /></code>
 
<code>          <Pt X="0" Y="1.75" /></code>
 
<code>          <Pt X="1" Y="1.25" /></code>
 
<code>          <Pt X="1.25" Y="0.5" /></code>
 
<code>          <Pt X="0.5" Y="0" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="1.5" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="2.75" /></code>
 
<code>          <Pt X="0" Y="3.5" /></code>
 
<code>          <Pt X="1" Y="4" /></code>
 
<code>          <Pt X="1.75" Y="3.75" /></code>
 
<code>          <Pt X="2.5" Y="3.75" /></code>
 
<code>          <Pt X="4" Y="3" /></code>
 
<code>          <Pt X="4.5" Y="2.25" /></code>
 
<code>          <Pt X="4" Y="1.5" /></code>
 
<code>          <Pt X="2.5" Y="1" /></code>
 
<code>          <Pt X="1.75" Y="1.25" /></code>
 
<code>          <Pt X="1.5" Y="1.75" /></code>
 
<code>          <Pt X="0.5" Y="2.25" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="4" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="0.25" /></code>
 
<code>          <Pt X="0.125" Y="1" /></code>
 
<code>          <Pt X="1.25" Y="1.25" /></code>
 
<code>          <Pt X="1.75" Y="0.75" /></code>
 
<code>          <Pt X="1.25" Y="0.375" /></code>
 
<code>          <Pt X="0.75" Y="0" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="3.5" DY="0" /></code>
 
<code>      </Line></code>
 
<code>    </Fill></code>
 
<code>    <Fill Type="LineFill" Direction="0" Distance="9" Color="clFill"></code>
 
<code>      <Origin X="0" Y="6.25" /></code>
 
<code>      <Line Type="ElemLine"></code>
 
<code>        <Elem Kind="Move" DX="0.25" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="2" /></code>
 
<code>          <Pt X="0.25" Y="2.5" /></code>
 
<code>          <Pt X="1" Y="2" /></code>
 
<code>          <Pt X="1" Y="1.75" /></code>
 
<code>          <Pt X="0.625" Y="1.5" /></code>
 
<code>          <Pt X="0.25" Y="1.75" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="3.75" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="2" /></code>
 
<code>          <Pt X="0.25" Y="2.25" /></code>
 
<code>          <Pt X="0.75" Y="2" /></code>
 
<code>          <Pt X="0.75" Y="1.5" /></code>
 
<code>          <Pt X="0.25" Y="1.5" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="1.25" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="1" /></code>
 
<code>          <Pt X="0" Y="1.5" /></code>
 
<code>          <Pt X="0.25" Y="1.75" /></code>
 
<code>          <Pt X="0.75" Y="1.75" /></code>
 
<code>          <Pt X="0.75" Y="1.25" /></code>
 
<code>          <Pt X="0.75" Y="1" /></code>
 
<code>          <Pt X="0.375" Y="0.75" /></code>
 
<code>        </Elem></code>
 
<code>        <Elem Kind="Move" DX="1.75" DY="0" /></code>
 
<code>        <Elem Kind="Polygon" ShapeFilled="true"></code>
 
<code>          <Pt X="0" Y="0.5" /></code>
 
<code>          <Pt X="0" Y="2.5" /></code>
 
<code>          <Pt X="0.5" Y="3" /></code>
 
<code>          <Pt X="1.5" Y="2.75" /></code>
 
<code>          <Pt X="1.75" Y="1.5" /></code>
 
<code>          <Pt X="2.25" Y="1" /></code>


<code>  <HatchDefinition Direction="0" Distance="2" Shift="4"></code>
<code>          <Pt X="1.75" Y="0.25" /></code>


<code>    <Line Type="ElemLine"></code>
<code>          <Pt X="1" Y="0" /></code>


<code>      <Elem Kind="Line" DX="2" DY="0" /></code>
<code>          <Pt X="0.5" Y="0.25" /></code>


<code>      <Elem Kind="Move" DX="-1" DY="1" /></code>
<code>        </Elem></code>


<code>      <Elem Kind="Line" DX="0" DY="-2" /></code>
<code>        <Elem Kind="Move" DX="2" DY="0" /></code>


<code>      <Elem Kind="Move" DX="7" DY="0" /></code>
<code>      </Line></code>


<code>    </Line></code>
<code>    </Fill></code>


<code>  </HatchDefinition></code>
<code>  </Fill></code>


<code></Item></code>
<code></Fill></code>

Latest revision as of 15:11, 23 June 2022

Used to store hatch definition. Hatch contains serie (one or more) of fills. There are three types of fills - StandardFill, LineFill, CompositeFill.

Data XML definition

Property XML Description Default
Type [A] Type Type of hatch, possible values StandardFill, LineFill or CompositeFill (empty)

StandardFill


Area filled with solid color.

Property XML Description Default
Color [A] Color Color of fill clDefault

Example of Data XML

<Fill Type="StandardFill" Color="clFill">

LineFill


Area filled with sequence of lines separated by distance. All lines are oriented in one direction.

Property XML Description Default
Line direction [A] Direction Direction of line [rad] (empty)
Line origin [E] Origin Point defining origin of the line [mm] 0, 0
Line distance [A] Distance Distance of parallel lines [mm] (empty)
Line shift [A] Shift Shift of next line (in direction of line) [mm] (empty)
Line definition [E] Line Definition of the line, if there is more than 1 line definition, lines are drawn in sequence Line1->Distance->Line2->Distance->...->Line1->... (empty)
Color [A] Color Color of fill clDefault

Example of Data XML

<Fill Direction="0" Distance="2" Shift="4">

  <Line Type="ElemLine">

    <Elem Kind="Line" DX="2" DY="0" />

    <Elem Kind="Move" DX="-1" DY="1" />

    <Elem Kind="Line" DX="0" DY="-2" />

    <Elem Kind="Move" DX="7" DY="0" />

  </Line>

</Fill>

CompositeFill


This type is aggregate for drawing multiple fill in same area.

Property XML Description Default
Fill [E] Fill Definition of child hatch. May contain one or more fills. (empty)

Example of Data XML - Multiple line hatch

<Fill Type="CompositeFill">

  <Fill Type="StandardFill" />

  <Fill Type="CompositeFill">

    <Fill Type="LineFill" Direction="0" Distance="9" Color="clFill">

      <Line Type="ElemLine">

        <Elem Kind="Move" DX="1.5" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="0" />

          <Pt X="-0.75" Y="1.25" />

          <Pt X="-0.75" Y="2.25" />

          <Pt X="-0.25" Y="2.5" />

          <Pt X="1.75" Y="2.25" />

          <Pt X="2" Y="1" />

          <Pt X="2.25" Y="0.75" />

          <Pt X="1.5" Y="0" />

        </Elem>

        <Elem Kind="Move" DX="3.75" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="0.25" />

          <Pt X="-0.25" Y="1.25" />

          <Pt X="0.5" Y="1.5" />

          <Pt X="0.75" Y="1.25" />

          <Pt X="0.75" Y="0.5" />

          <Pt X="0.5" Y="0.25" />

        </Elem>

        <Elem Kind="Move" DX="1.25" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="2" />

          <Pt X="0.25" Y="2.75" />

          <Pt X="1" Y="3" />

          <Pt X="1.75" Y="2.75" />

          <Pt X="2.25" Y="2" />

          <Pt X="2.25" Y="1.25" />

          <Pt X="1.5" Y="0.75" />

          <Pt X="1" Y="0.75" />

          <Pt X="0.25" Y="1.25" />

        </Elem>

        <Elem Kind="Move" DX="2.5" DY="0" />

      </Line>

    </Fill>

    <Fill Type="LineFill" Direction="0" Distance="9" Color="clFill">

      <Origin X="0" Y="3.25" />

      <Line Type="ElemLine">

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="0.25" />

          <Pt X="0" Y="1.75" />

          <Pt X="1" Y="1.25" />

          <Pt X="1.25" Y="0.5" />

          <Pt X="0.5" Y="0" />

        </Elem>

        <Elem Kind="Move" DX="1.5" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="2.75" />

          <Pt X="0" Y="3.5" />

          <Pt X="1" Y="4" />

          <Pt X="1.75" Y="3.75" />

          <Pt X="2.5" Y="3.75" />

          <Pt X="4" Y="3" />

          <Pt X="4.5" Y="2.25" />

          <Pt X="4" Y="1.5" />

          <Pt X="2.5" Y="1" />

          <Pt X="1.75" Y="1.25" />

          <Pt X="1.5" Y="1.75" />

          <Pt X="0.5" Y="2.25" />

        </Elem>

        <Elem Kind="Move" DX="4" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="0.25" />

          <Pt X="0.125" Y="1" />

          <Pt X="1.25" Y="1.25" />

          <Pt X="1.75" Y="0.75" />

          <Pt X="1.25" Y="0.375" />

          <Pt X="0.75" Y="0" />

        </Elem>

        <Elem Kind="Move" DX="3.5" DY="0" />

      </Line>

    </Fill>

    <Fill Type="LineFill" Direction="0" Distance="9" Color="clFill">

      <Origin X="0" Y="6.25" />

      <Line Type="ElemLine">

        <Elem Kind="Move" DX="0.25" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="2" />

          <Pt X="0.25" Y="2.5" />

          <Pt X="1" Y="2" />

          <Pt X="1" Y="1.75" />

          <Pt X="0.625" Y="1.5" />

          <Pt X="0.25" Y="1.75" />

        </Elem>

        <Elem Kind="Move" DX="3.75" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="2" />

          <Pt X="0.25" Y="2.25" />

          <Pt X="0.75" Y="2" />

          <Pt X="0.75" Y="1.5" />

          <Pt X="0.25" Y="1.5" />

        </Elem>

        <Elem Kind="Move" DX="1.25" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="1" />

          <Pt X="0" Y="1.5" />

          <Pt X="0.25" Y="1.75" />

          <Pt X="0.75" Y="1.75" />

          <Pt X="0.75" Y="1.25" />

          <Pt X="0.75" Y="1" />

          <Pt X="0.375" Y="0.75" />

        </Elem>

        <Elem Kind="Move" DX="1.75" DY="0" />

        <Elem Kind="Polygon" ShapeFilled="true">

          <Pt X="0" Y="0.5" />

          <Pt X="0" Y="2.5" />

          <Pt X="0.5" Y="3" />

          <Pt X="1.5" Y="2.75" />

          <Pt X="1.75" Y="1.5" />

          <Pt X="2.25" Y="1" />

          <Pt X="1.75" Y="0.25" />

          <Pt X="1" Y="0" />

          <Pt X="0.5" Y="0.25" />

        </Elem>

        <Elem Kind="Move" DX="2" DY="0" />

      </Line>

    </Fill>

  </Fill>

</Fill>