My favorites | English | Sign in

Faster apps faster - GWT 2.0 with Speed Tracer New!

Google SketchUp Ruby API

EdgeUse

class

Parent: Entity

Introduction

SketchUp 6.0+

The EdgeUse class defines how an Edge is used in the definition of a Face.

Methods

EdgeUse.edgeSketchUp 6.0+

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

Returns:

edge
an Edge object used by this edge use
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 edge = edgeuse.edge
 if (edge)
   UI.messagebox edge
 else
   UI.messagebox "Failure"
 end

EdgeUse.end_vertex_normalSketchUp 6.0+

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

Returns:

vector3D
a vector3d object if successful.
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 vector3d = edgeuse.end_vertex_normal

EdgeUse.faceSketchUp 6.0+

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

Returns:

face
a Face object used by this edge use
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 face = edgeuse.face
 if (face)
   UI.messagebox face
 else
   UI.messagebox "Failure"
 end

EdgeUse.loopSketchUp 6.0+

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

Returns:

loop
a Loop object that contains this edge use.
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 loop = edgeuse.loop
 if (loop)
   UI.messagebox loop
 else
   UI.messagebox "Failure"
 end

EdgeUse.nextSketchUp 6.0+

The next method is used to retrieve the next edge use in a loop.

Returns:

next
the next EdgeUse object in a loop
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 eunext = edgeuse.next
 if (eunext)
   UI.messagebox eunext
 else
   UI.messagebox "Failure"
 end

EdgeUse.partnersSketchUp 6.0+

The partners method is used to retrieve all of the partner edge uses. This method allows you to find all Faces that use an edge.

Returns:

partners
an array of partner Edge Use objects.
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 pts2 = []
 pts2[0] = [100, 0, 0]
 pts2[1] = [200, 0, 0]
 pts2[2] = [200, 100, 0]
 pts2[3] = [100,100,0]
 # Add the face to the entities in the model
 face2 = entities.add_face pts2
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[1]
 p = edgeuse.partners
 if (p)
   UI.messagebox p
 else
   UI.messagebox "Failure"
 end

EdgeUse.previousSketchUp 6.0+

The previous method is used to retrieve the previous edge use in a loop.

Returns:

edgeuse
the previous Edge Use object in the loop
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 euprevious = edgeuse.previous
 if (euprevious)
   UI.messagebox euprevious
 else
   UI.messagebox "Failure"
 end

EdgeUse.reversed?SketchUp 6.0+

The reversed? method is used to determine if the edge is reversed in this use.

Returns:

status
true if reversed, false if not reversed.
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 status = edgeuse.reversed?
 if (status)
   UI.messagebox status
 else
   UI.messagebox "Failure"
 end

EdgeUse.start_vertex_normalSketchUp 6.0+

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

Returns:

vector3D
a vector3d object if successful.
 depth = 100
 width = 100
 model = Sketchup.active_model
 entities = model.active_entities
 pts = []
 pts[0] = [0, 0, 0]
 pts[1] = [width, 0, 0]
 pts[2] = [width, depth, 0]
 pts[3] = [0, depth, 0]
 # Add the face to the entities in the model
 face = entities.add_face pts
 loop = face.outer_loop
 edgeuses = loop.edgeuses
 edgeuse = edgeuses[0]
 vector3d = edgeuse.start_vertex_normal