Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

80 lines
3.0 KiB
XML
Executable File

<?xml version="1.0" encoding="iso-8859-1"?>
<xml>
<include src="settings/generic.xml"/>
<synopsis
name="RSegment"
description="a part of a Contour, a series of severall off and one oncurve Points"
keywords="objects, segment, contour"/>
<title>RoboFab Objects: RSegment</title>
<div id="titlepic">
<img src="img/offdrawmodel_34.gif" alt="" border="0"/>
</div>
<div class="content">
<h1>RoboFab RSegment</h1>
<h3>Usage</h3>
<pythonsource src="examples/usageSegment.py"/>
<python type="output"><![CDATA[
< RSegment for RoboFab Demo Font.R[0][0] >
< RSegment for RoboFab Demo Font.R[0][1] >
< RSegment for RoboFab Demo Font.R[0][2] >
< RSegment for RoboFab Demo Font.R[0][3] >
< RSegment for RoboFab Demo Font.R[0][4] >
]]></python>
<h3>Description</h3>
<p>
A Contour object is a list of segments. A segment is a list of points with some special attributes and methods. See the LettError wiki for a <a href="http://just.letterror.com/ltrwiki/SegmentsVersusPoints">comprehensive explanation of segments</a>.
</p>
<h3>Understanding Contours and outlines</h3>
<p>
The way outline data is organised in RoboFab, and how the various objects relate is described here: <a href="howto/understandcontours.html">understanding contours</a>.
</p>
<h3>Attributes</h3>
<ul>
<li>
<strong>type</strong>: Type of segment
</li>
<li>
<strong>smooth</strong>: True if the segment is smooth, False if not.
</li>
<li>
<strong>selected</strong>: Returns True if the segment is selected, False if not.
</li>
<li>
<strong>points</strong>: List of points in the segment.
</li>
<li>
<strong>onCurve</strong>: Returns the oncurve point associated with the segment.
</li>
<li>
<strong>offCurve</strong>: Returns a list of offcurve points associated with the segment.
</li>
</ul>
<h3>Attribute examples</h3>
<pythonsource src="examples/segmentAttributes.py"/>
<h3>Methods</h3>
<p>
</p>
<ul>
<li><strong>copy()</strong>: return a deepcopy of the object.</li>
<li><strong>move((x, y))</strong>: move the anchor of the bPoint to (x,y). The relative coordinates of the bcpIn and bcpOut will remain the same, which means that in fact, they move the same distance.</li>
<li><strong>round()</strong>: round the coordinates to whole integers.</li>
<li><strong>transform(matrix)</strong>: Transform this point. Use a Transform matrix
object to mess with the point. <a href="howto/usetransformations.html">See how to use transformations</a>.</li>
</ul>
<h3>Method examples</h3>
<pythonsource src="examples/segmentMethods.py"/>
</div>
</xml>