Class: Sketchup::Vertex

Inherits:
Entity
  • Object
show all

Overview

A Vertex. A Vertex represents the end of an Edge or a point inside a Face.

Version:

  • SketchUp 6.0

Instance Method Summary # collapse

Methods inherited from Entity

#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?

Instance Method Details

#common_edge(vertex2) ⇒ Sketchup::Edge?

The common_edge method is used to find a common edge that is defined by this vertex and another vertex

Examples:

edge = entities[0]
# returns array of vertices that make up the line
verticies = edge.vertices
vertex1 = verticies[0]
vertex2 = verticies[1]
edge = vertex1.common_edge vertex2
if (edge)
  UI.messagebox edge
else
  UI.messagebox "Failure"
end

Parameters:

Returns:

  • (Sketchup::Edge, nil)

    an Edge object common to both vertices if successful. Returns nil if there is no edge between the two vertices.

Version:

  • SketchUp 6.0

#curve_interior?Boolean

Note:

This method doesn't actually return a boolean as the question mark post-fix would normally indicate. But the result still evaluates to truthy or falsy.

The #curve_interior? method is used to determine if this vertex is on the interior of a Curve.

Examples:

edge = entities[0]
# returns array of vertices that make up the line
verticies = edge.vertices
vertex1 = verticies[0]
status = vertex1.curve_interior?
if (status)
  UI.messagebox status
else
  #returns nil if vertex is not on interior of a Curve
  UI.messagebox "Failure"
end

Returns:

  • (Boolean)

Version:

  • SketchUp 6.0

#edgesArray<Sketchup::Edge>

The edges method is used to retrieve an Array of edges that use the Vertex.

Examples:

edge = entities[0]
# Returns array of vertices that make up the line.
verticies = edge.vertices
vertex1 = verticies[0]
edges = vertex1.edges

Returns:

Version:

  • SketchUp 6.0

#facesArray<Sketchup::Face>

The faces method is used to retrieve an Array of faces that use the vertex.

Examples:

edge = entities[0]
# Returns array of vertices that make up the line.
verticies = edge.vertices
vertex1 = verticies[0]
faces = vertex1.faces

Returns:

Version:

  • SketchUp 6.0

#loopsArray<Sketchup::Loop>

The loops method is used to retrieve an Array of loops that use the vertex.

Examples:

edge = entities[0]
# Returns array of vertices that make up the line.
verticies = edge.vertices
vertex1 = verticies[0]
loops = vertex1.loops

Returns:

Version:

  • SketchUp 6.0

#positionGeom::Point3d

The position method is used to retrieve the Point3d position of a vertex.

Examples:

edge = entities[0]
# Returns array of vertices that make up the line.
verticies = edge.vertices
vertex1 = verticies[0]
position = vertex1.position

Returns:

  • (Geom::Point3d)

    a Point3d object representing the position of the vertex if successful

Version:

  • SketchUp 6.0

#used_by?(face_or_edge) ⇒ Boolean

The used_by? method is used to determine if the Vertex is used by a given Edge or Face.

Examples:

used = vertex1.used_by? my_face

Parameters:

Returns:

  • (Boolean)

Version:

  • SketchUp 6.0