aboutsummaryrefslogtreecommitdiff
path: root/upstream/clipper-6.4.2/Documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm
blob: 337ed7197602f9a4bc84b70c3d42a59afff06614 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<html>

<head>
    
  <script type="text/javascript" src="../../../../../Scripts/jquery.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
  </script>
    
  <script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
  </script>
    
  <link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
    
  <link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
  

  <title>ClipperOffset</title>

  <link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">

  <meta name="Ancestor" content="">

    
  <script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
  </script>
  
</head>

<body bgcolor="#FFFFFF">
    
  <!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
    
  <!-- DO NOT EDIT MANUALLY !!! -->
  
  <table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
    <tr>
      <td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
      </td>
      <td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
      </td>
      <td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
      </td>
    </tr>
  </table>
  <h1>ClipperOffset</h1>
<br>

  <p class="Body">The ClipperOffset class encapsulates the process of offsetting (inflating/deflating) both open and closed paths using a number of different join types and end types.<br><br> <em>(This class replaces the now deprecated OffsetPaths function which was less flexible.)</em><br><br> <b>Preconditions for offsetting:</b><br> 1. The orientations of closed paths must be consistent such that outer polygons share the same orientation, and any holes have the opposite orientation (ie non-zero filling). Open paths must be oriented with closed outer polygons.<br> 2. Polygons must not self-intersect. <br><br> <b>Limitations:</b><br> When offsetting, small artefacts may appear where polygons overlap. To avoid these artefacts, offset overlapping polygons separately.<br><br><br> <img src="../../../../../Images/offset1.png" alt="" width="310" height="314" border="0" align="right"> 
    <table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="560px">

      <tr>
        <td class="White">

          <pre class="brush: cpp;">
#include "clipper.hpp"  
...
using namespace ClipperLib;

int main()
{
  Path subj;
  Paths solution;
  subj &lt;&lt; 
    IntPoint(348,257) &lt;&lt; IntPoint(364,148) &lt;&lt; IntPoint(362,148) &lt;&lt; 
    IntPoint(326,241) &lt;&lt; IntPoint(295,219) &lt;&lt; IntPoint(258,88) &lt;&lt; 
    IntPoint(440,129) &lt;&lt; IntPoint(370,196) &lt;&lt; IntPoint(372,275);
  ClipperOffset co;
  co.AddPath(subj, jtRound, etClosedPolygon);
  co.Execute(solution, -7.0);
  
  //draw solution ...
  DrawPolygons(solution, 0x4000FF00, 0xFF009900);
}
          </pre>


        </td>
      </tr>

    </table> <div style="clear:both">&nbsp;</div> </p>

  <h2 id="Auto-Reference">Reference</h2>
  <table>
    <tr><th>Methods
      </th><th>Properties
      </th>
    </tr>
    <tr>
      <td colspan="2" class="White">In ClipperOffset:
      </td>
    </tr>
    <tr>
      <td><a href="Methods/AddPath.htm">AddPath</a>
      </td>
      <td><a href="Properties/ArcTolerance.htm">ArcTolerance</a>
      </td>
    </tr>
    <tr>
      <td><a href="Methods/AddPaths.htm">AddPaths</a>
      </td>
      <td><a href="Properties/MiterLimit.htm">MiterLimit</a>
      </td>
    </tr>
    <tr>
      <td><a href="Methods/Clear.htm">Clear</a>
      </td>
      <td>
      </td>
    </tr>
    <tr>
      <td><a href="Methods/Constructor.htm">Constructor</a>
      </td>
      <td>
      </td>
    </tr>
    <tr>
      <td><a href="Methods/Execute.htm">Execute</a>
      </td>
      <td>
      </td>
    </tr>
  </table>
    
  <p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
  
</body>

</html>