123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::Loop

Relationships
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Entity
Instance Chain:
self, Entity
Inherits: Sketchup::Entity

Overview

Loop is a low level topology class that will not need to be used often. A Loop is a chain of Edges that bound a Face.

Version:

  • SketchUp 6.0

Instance Attribute Summary

Entity - Inherited

#deleted?

The deleted? method is used to determine if your entity is still valid (not deleted by another script, for example.).

#valid?

The #valid? method is used to determine if your entity is still valid (not deleted by another script, for example).

Instance Method Summary

Entity - Inherited

#add_observer

The add_observer method is used to add an observer to the current object.

#attribute_dictionaries

The attribute_dictionaries method is used to retrieve the AttributeDictionaries collection attached to the entity.

#attribute_dictionary

The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an Entity.

#delete_attribute

The #delete_attribute method is used to delete an attribute from an entity.

#entityID

The entityID method is used to retrieve a unique ID assigned to an entity.

#get_attribute

The #get_attribute method is used to retrieve the value of an attribute in the entity’s attribute dictionary.

#inspect

The #inspect method is used to retrieve the string representation of the entity.

#model

The model method is used to retrieve the model for the entity.

#parent

The parent method is used to retrieve the parent of the entity.

#persistent_id

The #persistent_id method is used to retrieve a unique persistent id assigned to an entity.

#remove_observer

The remove_observer method is used to remove an observer from the current object.

#set_attribute

The set attribute is used to set the value of an attribute in an attribute dictionary with the given name.

#to_s

The #to_s method is used to retrieve the string representation of the entity.

#typename

The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”.

Instance Attribute Details

#convex?Boolean (readonly)

Determine if the loop is convex.

Examples:

entities = Sketchup.active_model.active_entities
points = []
points << Geom::Point3d.new(0, 0, 0)
points << Geom::Point3d.new(100, 0, 0)
points << Geom::Point3d.new(100, 200, 0)
points << Geom::Point3d.new(0, 200, 0)
face = entities.add_face(points)
loop = face.outer_loop
if loop.convex?
  puts "Loop is convex."
else
  puts "Loop is not convex."
end

Returns:

  • (Boolean)

    status - true if convex, false if not convex.

Version:

  • SketchUp 6.0

#outer?Boolean (readonly)

Determine if this is an outer loop. Each face has one outer loop, and will have one loop for each hole.

Examples:

entities = Sketchup.active_model.active_entities
points = []
points << Geom::Point3d.new(0, 0, 0)
points << Geom::Point3d.new(100, 0, 0)
points << Geom::Point3d.new(100, 200, 0)
points << Geom::Point3d.new(0, 200, 0)
face = entities.add_face(points)
loop = face.outer_loop
if loop.outer?
  puts "Loop is an outer loop."
else
  puts "Loop is not an outer loop."
end

Returns:

  • (Boolean)

    status - true if the loop is an outer loop, false if it is not an outer loop.

Version:

  • SketchUp 6.0

Instance Method Details

#edgesObject

Get an array of the edges that define the loop in an ordered sequence.

Examples:

entities = Sketchup.active_model.active_entities
points = []
points << Geom::Point3d.new(0, 0, 0)
points << Geom::Point3d.new(100, 0, 0)
points << Geom::Point3d.new(100, 200, 0)
points << Geom::Point3d.new(0, 200, 0)
face = entities.add_face(points)
loop = face.outer_loop
edges = loop.edges

Returns:

  • edges - an array of Edge objects if successful.

Version:

  • SketchUp 6.0

#edgeusesObject

Get an array of the EdgeUse objects that define this loop in an ordered sequence.

Examples:

entities = Sketchup.active_model.active_entities
points = []
points << Geom::Point3d.new(0, 0, 0)
points << Geom::Point3d.new(100, 0, 0)
points << Geom::Point3d.new(100, 200, 0)
points << Geom::Point3d.new(0, 200, 0)
face = entities.add_face(points)
loop = face.outer_loop
edgeuses = loop.edgeuses

Returns:

  • edgeuses - an array of EdgeUse objects if successful.

Version:

  • SketchUp 6.0

#faceObject

Get the Face object that is bounded by this loop.

Examples:

entities = Sketchup.active_model.active_entities
points = []
points << Geom::Point3d.new(0, 0, 0)
points << Geom::Point3d.new(100, 0, 0)
points << Geom::Point3d.new(100, 200, 0)
points << Geom::Point3d.new(0, 200, 0)
face = entities.add_face(points)
loop = face.outer_loop
loop_face = loop.face

Returns:

  • face - a Face object if successful

Version:

  • SketchUp 6.0

#verticesObject

Get an array of the vertices that define the loop in an ordered sequence.

Examples:

entities = Sketchup.active_model.active_entities
points = []
points << Geom::Point3d.new(0, 0, 0)
points << Geom::Point3d.new(100, 0, 0)
points << Geom::Point3d.new(100, 200, 0)
points << Geom::Point3d.new(0, 200, 0)
face = entities.add_face(points)
loop = face.outer_loop
vertices = loop.vertices

Returns:

  • vertices - an array of Vertex objects if successful.

Version:

  • SketchUp 6.0