# robofab manual
# Point object
# usage examples
contour = CurrentGlyph()
from random import randint
for p in contour.points:
p.x += randint(-10,10)
p.y += randint(-10,10)
< RPoint for AFont.A >
RPoint is perhaps the smallest object in RoboFab objects. It represents one single point with a particular coordinate in a contour. It is used to access off-curve and on-curve points alike. It's cousin, bPoint also provides access to incoming and outgoing bcps. RPoint is exclusively only one single point.
Understanding Contours and outlines
The way outline data is organised in RoboFab, and how the various objects relate is described here: understanding contours.
- x: the x coordinate of this point.
- y: the y coordinate of this point.
- type: the type of this point.
- selected: boolean for selection state. i.e. "True" or "False"
UFO only attributes
- name: the name of the point (UFO only)
- copy(): return a deepcopy of the object.
- move((x, y)): 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.
- round(): round the coordinates to whole integers.
- select(state=True): select this point.
- transform(matrix): Transform this point. Use a Transform matrix object to mess with the point. See how to use transformations.