Module: StraightSkeleton::InteriorNode

Includes:
Node
Included in:
Collapse, Split
Defined in:
lib/nswtopo/geometry/straight_skeleton/interior_node.rb

Instance Attribute Summary

Attributes included from Node

#neighbours, #normals, #original, #point, #travel

Instance Method Summary collapse

Methods included from Node

#active?, #index, #next, #prev, #project, #reflex?, #splits?, #terminal?

Instance Method Details

#<=>(other) ⇒ Object



5
6
7
# File 'lib/nswtopo/geometry/straight_skeleton/interior_node.rb', line 5

def <=>(other)
  (@travel <=> other.travel) * @nodes.direction
end

#insert!Object



9
10
11
12
13
14
15
# File 'lib/nswtopo/geometry/straight_skeleton/interior_node.rb', line 9

def insert!
  @normals = @neighbours.map.with_index do |neighbour, index|
    neighbour.neighbours[1-index] = self if neighbour
    neighbour.normals[1-index] if neighbour
  end
  @nodes.insert self
end