typerig.proxy.objects.node

typerig.proxy.objects.node (version 0.26.3)

# MODULE: Typerig / Proxy / Node (Obejcts)
# -----------------------------------------------------------
# (C) Vassil Kateliev, 2017-2020        (http://www.kateliev.com)
# (C) Karandash Type Foundry            (http://www.karandash.eu)
#------------------------------------------------------------
# www.typerig.com

Modules

  • fontgate
  • fontlab
  • math
  • PythonQt
  • random
  • typerig.core.objects

Classes

class eNode(pNode)

Extended representation of the Proxy Node, adding some advanced functionality

Constructor:
        eNode(flNode)

Method resolution order:
eNode
pNode
builtin.object

Methods

alignTo(self, entity, align=(True, True))

Align current node to a node or line given.
Arguments:
        entity (flNode, pNode, eNode or Line)
        align (tuple(Align_X (bool), Align_Y (bool))

asCoord(self)

Returns Coord object of the node.

cornerMitre(self, mitreSize=5, isRadius=False)

# - Corner operations ---------------

cornerRound(self, size=5, proportion=None, curvature=None, isRadius=False)



cornerTrap(self, aperture=10, depth=20, trap=2)

Trap a corner by given aperture.

Arguments:
        aperture (float): Width of the traps mouth (opening);
        depth (float): Length of the traps sides;
        trap (float): Width of the traps bottom.

Returns:
        tuple(flNode, flNode, flNode, flNode)

cornerTrapInc(self, incision=10, depth=50, trap=2, smooth=True)

Trap a corner by given incision into the glyph flesh.

Arguments:
        incision (float): How much to cut into glyphs flesh based from that corner inward;
        depth (float): Length of the traps sides;
        trap (float): Width of the traps bottom;
        smooth (bool): Creates a smooth trap.

Returns:
        tuple(flNode, flNode, flNode, flNode) four base (ON) nodes of the trap.

diffTo(self, node)



diffToNext(self)



diffToPrev(self)



getNextLine(self)



getPrevLine(self)



interpShift(self, shift_x, shift_y)

Interpolated move aka Interpolated Nudge.

Arguments:
        shift_x, shift_y (float)

polarReloc(self, angle, distance)



polarRelocFromPrev(self, distance)



polarTo(self, node)



polarToNext(self)



polarToPrev(self)



shiftFromNext(self, diffX, diffY)



shiftFromPrev(self, diffX, diffY)



slantShift(self, shift_x, shift_y, angle)

Slanted move - move a node (in inclined space) according to Y coordinate slanted at given angle.

Arguments:
        shift_x, shift_y (float)
        angle (float): Angle in degrees

smartPolarReloc(self, angle, distance)



Methods from pNode

init(self, node)



repr(self)



angleTo(self, node)



angleToNext(self)



angleToPrev(self)



delSmartAngle(self)



distanceTo(self, node)



distanceToNext(self)



distanceToPrev(self)



getContour(self)



getMaxY(self, naked=True)



getMinY(self, naked=True)



getNext(self, naked=True)



getNextOn(self, naked=True)



getOn(self, naked=True)



getPrev(self, naked=True)



getPrevOn(self, naked=True)



getSegment(self, relativeTime=0)



getSegmentNodes(self, relativeTime=0)



getSmartAngle(self)

# - Effects --------------------------------

getSmartAngleRadius(self)



getTime(self)

# - Basics -----------------------------------------------

insertAfter(self, time)



insertAfterDist(self, distance)



insertBefore(self, time)



insertBeforeDist(self, distance)



reloc(self, newX, newY)

Relocate the node to new coordinates

remove(self)



setSmartAngle(self, radius)



setSmartAngleRadius(self, radius)



shift(self, deltaX, deltaY)

Shift the node by given amout

smartReloc(self, newX, newY)

Relocate the node and adjacent BCPs to new coordinates

smartShift(self, deltaX, deltaY)

Shift the node and adjacent BCPs by given amout

update(self)



Descriptors from pNode

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

class eNodesContainer(pNodesContainer)

Extended representation of Abstract nodes container

Constructor:
        eNodesContainer(list(flNode))

Methods

alignTo(self, entity, alignMode='', align=(True, True))

Align Abstract nodes container to.
Arguments:
        entity ()
        alignMode (String) : L(left), R(right), C(center), T(top), B(bottom), E(vertical center) !ORDER MATTERS

Methods from pNodesContainer

delitem(self, index)



getitem(self, index)



hash(self)



init(self, nodeList, extend=<class 'typerig.proxy.objects.node.pNode'>)



len(self)



repr(self)



setitem(self, index, value)



append(self, index)



applyTransform(self, transform)



clone(self)



cloneTransform(self, transform)



getBounds(self)



getCoord(self)



getPosition(self)



insert(self, index, value)



reverse(self)



shift(self, dx, dy)



smartShift(self, dx, dy)



Descriptors from pNodesContainer

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

class pNode(builtin.object)

Proxy to flNode object

Constructor:
        pNode(flNode)

Attributes:
        .fl (flNode): Original flNode 
        .parent (flContour): parent contour
        .contour (flContour): parent contour

Methods

init(self, node)



repr(self)



angleTo(self, node)



angleToNext(self)



angleToPrev(self)



delSmartAngle(self)



distanceTo(self, node)



distanceToNext(self)



distanceToPrev(self)



getContour(self)



getMaxY(self, naked=True)



getMinY(self, naked=True)



getNext(self, naked=True)



getNextOn(self, naked=True)



getOn(self, naked=True)



getPrev(self, naked=True)



getPrevOn(self, naked=True)



getSegment(self, relativeTime=0)



getSegmentNodes(self, relativeTime=0)



getSmartAngle(self)

# - Effects --------------------------------

getSmartAngleRadius(self)



getTime(self)

# - Basics -----------------------------------------------

insertAfter(self, time)



insertAfterDist(self, distance)



insertBefore(self, time)



insertBeforeDist(self, distance)



reloc(self, newX, newY)

Relocate the node to new coordinates

remove(self)



setSmartAngle(self, radius)



setSmartAngleRadius(self, radius)



shift(self, deltaX, deltaY)

Shift the node by given amout

smartReloc(self, newX, newY)

Relocate the node and adjacent BCPs to new coordinates

smartShift(self, deltaX, deltaY)

Shift the node and adjacent BCPs by given amout

update(self)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

class pNodesContainer(builtin.object)

Abstract nodes container

Constructor:
        pNodesContainer(list(flNode))

Attributes:

Methods

delitem(self, index)



getitem(self, index)



hash(self)



init(self, nodeList, extend=<class 'typerig.proxy.objects.node.pNode'>)



len(self)



repr(self)



setitem(self, index, value)



append(self, index)



applyTransform(self, transform)



clone(self)



cloneTransform(self, transform)



getBounds(self)



getCoord(self)



getPosition(self)



insert(self, index, value)



reverse(self)



shift(self, dx, dy)



smartShift(self, dx, dy)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

pNode

typerig.proxy.objects.node.pNode = class pNode(__builtin__.object)

Proxy to flNode object

Constructor:
        pNode(flNode)

Attributes:
        .fl (flNode): Original flNode 
        .parent (flContour): parent contour
        .contour (flContour): parent contour

Methods

__init__(self, node)


__repr__(self)


angleTo(self, node)


angleToNext(self)


angleToPrev(self)


delSmartAngle(self)


distanceTo(self, node)


distanceToNext(self)


distanceToPrev(self)


getContour(self)


getMaxY(self, naked=True)


getMinY(self, naked=True)


getNext(self, naked=True)


getNextOn(self, naked=True)


getOn(self, naked=True)


getPrev(self, naked=True)


getPrevOn(self, naked=True)


getSegment(self, relativeTime=0)


getSegmentNodes(self, relativeTime=0)


getSmartAngle(self)
# - Effects --------------------------------
getSmartAngleRadius(self)


getTime(self)
# - Basics -----------------------------------------------
insertAfter(self, time)


insertAfterDist(self, distance)


insertBefore(self, time)


insertBeforeDist(self, distance)


reloc(self, newX, newY)
Relocate the node to new coordinates
remove(self)


setSmartAngle(self, radius)


setSmartAngleRadius(self, radius)


shift(self, deltaX, deltaY)
Shift the node by given amout
smartReloc(self, newX, newY)
Relocate the node and adjacent BCPs to new coordinates
smartShift(self, deltaX, deltaY)
Shift the node and adjacent BCPs by given amout
update(self)


Descriptors

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

reloc

typerig.proxy.objects.node.pNode.reloc = reloc(self, newX, newY) unbound typerig.proxy.objects.node.pNode method
Relocate the node to new coordinates

shift

typerig.proxy.objects.node.pNode.shift = shift(self, deltaX, deltaY) unbound typerig.proxy.objects.node.pNode method
Shift the node by given amout

smartReloc

typerig.proxy.objects.node.pNode.smartReloc = smartReloc(self, newX, newY) unbound typerig.proxy.objects.node.pNode method
Relocate the node and adjacent BCPs to new coordinates

smartShift

typerig.proxy.objects.node.pNode.smartShift = smartShift(self, deltaX, deltaY) unbound typerig.proxy.objects.node.pNode method
Shift the node and adjacent BCPs by given amout

pNodesContainer

typerig.proxy.objects.node.pNodesContainer = class pNodesContainer(__builtin__.object)

Abstract nodes container

Constructor:
        pNodesContainer(list(flNode))

Attributes:

Methods

__delitem__(self, index)


__getitem__(self, index)


__hash__(self)


__init__(self, nodeList, extend=<class 'typerig.proxy.objects.node.pNode'>)


__len__(self)


__repr__(self)


__setitem__(self, index, value)


append(self, index)


applyTransform(self, transform)


clone(self)


cloneTransform(self, transform)


getBounds(self)


getCoord(self)


getPosition(self)


insert(self, index, value)


reverse(self)


shift(self, dx, dy)


smartShift(self, dx, dy)


Descriptors

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

eNode

typerig.proxy.objects.node.eNode = class eNode(pNode)

Extended representation of the Proxy Node, adding some advanced functionality

Constructor:
        eNode(flNode)
Method resolution order:
eNode
pNode
__builtin__.object

Methods

alignTo(self, entity, align=(True, True))
Align current node to a node or line given.
Arguments:
        entity (flNode, pNode, eNode or Line)
        align (tuple(Align_X (bool), Align_Y (bool))
asCoord(self)
Returns Coord object of the node.
cornerMitre(self, mitreSize=5, isRadius=False)
# - Corner operations ---------------
cornerRound(self, size=5, proportion=None, curvature=None, isRadius=False)


cornerTrap(self, aperture=10, depth=20, trap=2)
Trap a corner by given aperture.

Arguments:
        aperture (float): Width of the traps mouth (opening);
        depth (float): Length of the traps sides;
        trap (float): Width of the traps bottom.

Returns:
        tuple(flNode, flNode, flNode, flNode)
cornerTrapInc(self, incision=10, depth=50, trap=2, smooth=True)
Trap a corner by given incision into the glyph flesh.

Arguments:
        incision (float): How much to cut into glyphs flesh based from that corner inward;
        depth (float): Length of the traps sides;
        trap (float): Width of the traps bottom;
        smooth (bool): Creates a smooth trap.

Returns:
        tuple(flNode, flNode, flNode, flNode) four base (ON) nodes of the trap.
diffTo(self, node)


diffToNext(self)


diffToPrev(self)


getNextLine(self)


getPrevLine(self)


interpShift(self, shift_x, shift_y)
Interpolated move aka Interpolated Nudge.

Arguments:
        shift_x, shift_y (float)
polarReloc(self, angle, distance)


polarRelocFromPrev(self, distance)


polarTo(self, node)


polarToNext(self)


polarToPrev(self)


shiftFromNext(self, diffX, diffY)


shiftFromPrev(self, diffX, diffY)


slantShift(self, shift_x, shift_y, angle)
Slanted move - move a node (in inclined space) according to Y coordinate slanted at given angle.

Arguments:
        shift_x, shift_y (float)
        angle (float): Angle in degrees
smartPolarReloc(self, angle, distance)


Methods from pNode

__init__(self, node)


__repr__(self)


angleTo(self, node)


angleToNext(self)


angleToPrev(self)


delSmartAngle(self)


distanceTo(self, node)


distanceToNext(self)


distanceToPrev(self)


getContour(self)


getMaxY(self, naked=True)


getMinY(self, naked=True)


getNext(self, naked=True)


getNextOn(self, naked=True)


getOn(self, naked=True)


getPrev(self, naked=True)


getPrevOn(self, naked=True)


getSegment(self, relativeTime=0)


getSegmentNodes(self, relativeTime=0)


getSmartAngle(self)
# - Effects --------------------------------
getSmartAngleRadius(self)


getTime(self)
# - Basics -----------------------------------------------
insertAfter(self, time)


insertAfterDist(self, distance)


insertBefore(self, time)


insertBeforeDist(self, distance)


reloc(self, newX, newY)
Relocate the node to new coordinates
remove(self)


setSmartAngle(self, radius)


setSmartAngleRadius(self, radius)


shift(self, deltaX, deltaY)
Shift the node by given amout
smartReloc(self, newX, newY)
Relocate the node and adjacent BCPs to new coordinates
smartShift(self, deltaX, deltaY)
Shift the node and adjacent BCPs by given amout
update(self)


Descriptors from pNode

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

asCoord

typerig.proxy.objects.node.eNode.asCoord = asCoord(self) unbound typerig.proxy.objects.node.eNode method
Returns Coord object of the node.

cornerTrap

typerig.proxy.objects.node.eNode.cornerTrap = cornerTrap(self, aperture=10, depth=20, trap=2) unbound typerig.proxy.objects.node.eNode method
Trap a corner by given aperture.

Arguments:
        aperture (float): Width of the traps mouth (opening);
        depth (float): Length of the traps sides;
        trap (float): Width of the traps bottom.

Returns:
        tuple(flNode, flNode, flNode, flNode)

cornerTrapInc

typerig.proxy.objects.node.eNode.cornerTrapInc = cornerTrapInc(self, incision=10, depth=50, trap=2, smooth=True) unbound typerig.proxy.objects.node.eNode method
Trap a corner by given incision into the glyph flesh.

Arguments:
        incision (float): How much to cut into glyphs flesh based from that corner inward;
        depth (float): Length of the traps sides;
        trap (float): Width of the traps bottom;
        smooth (bool): Creates a smooth trap.

Returns:
        tuple(flNode, flNode, flNode, flNode) four base (ON) nodes of the trap.

interpShift

typerig.proxy.objects.node.eNode.interpShift = interpShift(self, shift_x, shift_y) unbound typerig.proxy.objects.node.eNode method
Interpolated move aka Interpolated Nudge.

Arguments:
        shift_x, shift_y (float)

slantShift

typerig.proxy.objects.node.eNode.slantShift = slantShift(self, shift_x, shift_y, angle) unbound typerig.proxy.objects.node.eNode method
Slanted move - move a node (in inclined space) according to Y coordinate slanted at given angle.

Arguments:
        shift_x, shift_y (float)
        angle (float): Angle in degrees

alignTo

typerig.proxy.objects.node.eNode.alignTo = alignTo(self, entity, align=(True, True)) unbound typerig.proxy.objects.node.eNode method
Align current node to a node or line given.
Arguments:
        entity (flNode, pNode, eNode or Line)
        align (tuple(Align_X (bool), Align_Y (bool))

eNodesContainer

typerig.proxy.objects.node.eNodesContainer = class eNodesContainer(pNodesContainer)

Extended representation of Abstract nodes container

Constructor:
        eNodesContainer(list(flNode))

Methods

alignTo(self, entity, alignMode='', align=(True, True))
Align Abstract nodes container to.
Arguments:
        entity ()
        alignMode (String) : L(left), R(right), C(center), T(top), B(bottom), E(vertical center) !ORDER MATTERS

Methods from pNodesContainer

__delitem__(self, index)


__getitem__(self, index)


__hash__(self)


__init__(self, nodeList, extend=<class 'typerig.proxy.objects.node.pNode'>)


__len__(self)


__repr__(self)


__setitem__(self, index, value)


append(self, index)


applyTransform(self, transform)


clone(self)


cloneTransform(self, transform)


getBounds(self)


getCoord(self)


getPosition(self)


insert(self, index, value)


reverse(self)


shift(self, dx, dy)


smartShift(self, dx, dy)


Descriptors from pNodesContainer

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

alignTo

typerig.proxy.objects.node.eNodesContainer.alignTo = alignTo(self, entity, alignMode='', align=(True, True)) unbound typerig.proxy.objects.node.eNodesContainer method
Align Abstract nodes container to.
Arguments:
        entity ()
        alignMode (String) : L(left), R(right), C(center), T(top), B(bottom), E(vertical center) !ORDER MATTERS