Class: Sketchup::EdgeUse

Inherits:
Entity
  • Object
show all

Overview

The EdgeUse class defines how an Edge is used in the definition of 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

#edgeObject

The edge method is used to retrieve the edge for the edge use.

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
edgeuse = edgeuses[0]
edge = edgeuse.edge

Returns:

  • edge - an Edge object used by this edge use

Version:

  • SketchUp 6.0

#end_vertex_normalObject

The end_vertex_normal method is used to retrieve the vertex normal for the end point of this edgeuse.

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
edgeuse = edgeuses[0]
vector3d = edgeuse.end_vertex_normal

Returns:

  • vector3d - a vector3d object if successful.

Version:

  • SketchUp 6.0

#faceObject

The face method is used to retrieve the face used by this edge use.

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
edgeuse = edgeuses[0]
face = edgeuse.face

Returns:

  • face - a Face object used by this edge use

Version:

  • SketchUp 6.0

#loopObject

The loop method is used to retrieve the loop for this edge use.

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
edgeuse = edgeuses[0]
loop = edgeuse.loop

Returns:

  • loop - a Loop object that contains this edge use.

Version:

  • SketchUp 6.0

#nextObject

The next method is used to retrieve the next edge use in a 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
edgeuses = loop.edgeuses
edgeuse = edgeuses[0]
next_edgeuse = edgeuse.next

Returns:

  • edgeuse - the next EdgeUse object in a loop

Version:

  • SketchUp 6.0

#partnersObject

The partners method is used to retrieve all of the partner edge uses that uses the same edge.

Examples:

entities = Sketchup.active_model.active_entities
points1 = []
points1 << Geom::Point3d.new(0, 0, 0)
points1 << Geom::Point3d.new(100, 0, 0)
points1 << Geom::Point3d.new(100, 200, 0)
points1 << Geom::Point3d.new(0, 200, 0)
face1 = entities.add_face(points1)
points2 = []
points2 << Geom::Point3d.new(100, 0, 0)
points2 << Geom::Point3d.new(200, 0, 0)
points2 << Geom::Point3d.new(200, 200, 0)
points2 << Geom::Point3d.new(100, 200, 0)
face2 = entities.add_face(points2)
loop = face1.outer_loop
edgeuses = loop.edgeuses
edgeuse = edgeuses[1]
partners = edgeuse.partners

Returns:

  • array - an array of partner Edge Use objects.

Version:

  • SketchUp 6.0

#previousObject

The previous method is used to retrieve the previous edge use in a 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
edgeuses = loop.edgeuses
edgeuse = edgeuses[0]
previous_edgeuse = edgeuse.previous

Returns:

  • edgeuse - the previous Edge Use object in the loop

Version:

  • SketchUp 6.0

#reversed?Object

The reversed? method is used to determine if the edge direction is opposite of the edge use direction. The edge use direction is the same as the loop it belongs to.

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
edgeuse = edgeuses[0]
reversed = edgeuse.reversed?

Returns:

  • boolean - true if reversed, false if not reversed.

  • (Boolean)

Version:

  • SketchUp 6.0

#start_vertex_normalObject

The start_vertex_normal method is used to retrieve the vertex normal for the start point of this edgeuse.

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
edgeuse = edgeuses[0]
vector3d = edgeuse.start_vertex_normal

Returns:

  • vector3d - a vector3d object if successful.

Version:

  • SketchUp 6.0