Class: Sketchup::Face
- Inherits:
-
Drawingelement
- Object
- Entity
- Drawingelement
- Sketchup::Face
- Defined in:
- lib/sketchup-api-stubs/stubs/Sketchup/Face.rb
Overview
Faces in SketchUp are flat, 2-sided polygons with 3 or more sides.
Constant Summary collapse
- PointInside =
Constants
nil
- PointNotOnPlane =
Stub value.
nil
- PointOnEdge =
Stub value.
nil
- PointOnFace =
Stub value.
nil
- PointOnVertex =
Stub value.
nil
- PointOutside =
Stub value.
nil
- PointUnknown =
Stub value.
nil
Instance Method Summary collapse
-
#all_connected ⇒ Array<Sketchup::Entity>
The all_connected method retrieves all of the entities connected to a face.
-
#area(*args) ⇒ Object
The area method is used to retrieve the area of a face in current units.
-
#back_material ⇒ Sketchup::Material?
The back_material method is used to retrieve the material assigned to the back side of the face.
-
#back_material=(material) ⇒ Sketchup::Material
The back_material= method is used to set the material assigned to the back side of the face.
-
#classify_point(point) ⇒ Integer
The classify_point method is used to determine if a given Point3d is on the referenced Face.
-
#edges ⇒ Array<Sketchup::Edge>
The edges method is used to get an array of edges that bound the face.
-
#followme(*args) ⇒ Object
The #followme method is used to create a shape by making the face follow along an array of edges.
-
#get_glued_instances ⇒ Array<Sketchup::ComponentInstance, Sketchup::Group, Sketchup::Image>
The get_glued_instances method returns an Array any ComponentInstances that are glued to the face.
-
#get_texture_projection(frontside) ⇒ Geom::Vector3d
The get_texture_projection method will return a vector representing the projection for either the front or back side of the face.
-
#get_UVHelper(*args) ⇒ Sketchup::UVHelper
The get_UVHelper object is used to retrieve a UVHelper object for use in texture manipulation on a face.
-
#loops ⇒ Array<Sketchup::Loop>
The loops method is used to get an array of all of the loops that bound the face.
-
#material ⇒ Sketchup::Material?
The material method is used to retrieve the material assigned to the front of the face.
-
#material=(material) ⇒ Sketchup::Material
The material= method is used to set the material assigned to the front side of the face.
-
#mesh(flags = 0) ⇒ Geom::PolygonMesh
The mesh method creates a polygon mesh that represents the face.
-
#normal ⇒ Geom::Vector3d
The normal method is used to retrieve the 3D vector normal to the face in the front direction.
-
#outer_loop ⇒ Sketchup::Loop
This method is used to retrieve the outer loop that bounds the face.
-
#plane ⇒ Array(Float, Float, Float, Float)
The plane method is used to retrieve the plane of the face.
-
#position_material(material, pt_array, o_front) ⇒ Sketchup::Face, false
The position_material method is used to position a material on a face.
-
#pushpull(distance, copy = false) ⇒ nil
The pushpull method is used to perform a push/pull on a face.
-
#reverse! ⇒ Sketchup::Face, false
The reverse! method is used to reverse the face’s orientation, meaning the front becomes the back.
-
#set_texture_projection(vector, frontside) ⇒ Boolean
deprecated
Deprecated.
This function never worked right. It’s not possible to control the position and orientation of the texture.
-
#vertices ⇒ Array<Sketchup::Vertex>
The vertices method is used to get an array of all of the vertices that bound the face.
Methods inherited from Drawingelement
#bounds, #casts_shadows=, #casts_shadows?, #erase!, #hidden=, #hidden?, #layer, #layer=, #receives_shadows=, #receives_shadows?, #visible=, #visible?
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
#all_connected ⇒ Array<Sketchup::Entity>
The all_connected method retrieves all of the entities connected to a face.
41 42 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 41 def all_connected end |
#area ⇒ Float #area(transform) ⇒ Float
The area method is used to retrieve the area of a face in current units.
You can pass in an optional Transformation (or an array that can represent a transformation), to correct for a parent group’s transformation. For example, if a face is inside of a group that is scaled to 200%, the area method will return the unscaled area of the face. So by passing a 200% transformation object to this method, you can account for that to get the “visual” area of the face.
78 79 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 78 def area(*args) end |
#back_material ⇒ Sketchup::Material?
The back_material method is used to retrieve the material assigned to the back side of the face.
106 107 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 106 def back_material end |
#back_material=(material) ⇒ Sketchup::Material
The back_material= method is used to set the material assigned to the back side of the face.
133 134 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 133 def back_material=(material) end |
#classify_point(point) ⇒ Integer
The classify_point method is used to determine if a given Point3d is on the referenced Face.
It is important that return value comparisons be made against the symbolic constants (i.e. PointUnknown, PointInside, PointOnVertex, etc.) rather than the absolute integer values as these values may change from one release to the next.
199 200 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 199 def classify_point(point) end |
#edges ⇒ Array<Sketchup::Edge>
The edges method is used to get an array of edges that bound the face.
221 222 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 221 def edges end |
#followme(edges) ⇒ Boolean #followme(edge) ⇒ Boolean
The #followme method is used to create a shape by making the face follow along an array of edges.
260 261 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 260 def followme(*args) end |
#get_glued_instances ⇒ Array<Sketchup::ComponentInstance, Sketchup::Group, Sketchup::Image>
The get_glued_instances method returns an Array any ComponentInstances that are glued to the face.
330 331 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 330 def get_glued_instances end |
#get_texture_projection(frontside) ⇒ Geom::Vector3d
The get_texture_projection method will return a vector representing the projection for either the front or back side of the face.
372 373 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 372 def get_texture_projection(frontside) end |
#get_UVHelper(front = true, back = true) ⇒ Sketchup::UVHelper #get_UVHelper(front = true, back = true, texturewriter) ⇒ Sketchup::UVHelper
The get_UVHelper object is used to retrieve a UVHelper object for use in texture manipulation on a face.
306 307 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 306 def get_UVHelper(*args) end |
#loops ⇒ Array<Sketchup::Loop>
The loops method is used to get an array of all of the loops that bound the face.
396 397 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 396 def loops end |
#material ⇒ Sketchup::Material?
The material method is used to retrieve the material assigned to the front of the face. (This method is inherited from the Drawingelement parent class.)
425 426 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 425 def material end |
#material=(material) ⇒ Sketchup::Material
The material= method is used to set the material assigned to the front side of the face. (This method is inherited from the Drawingelement parent class.)
453 454 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 453 def material=(material) end |
#mesh(flags = 0) ⇒ Geom::PolygonMesh
The mesh method creates a polygon mesh that represents the face. See the Geom::PolygonMesh class for more information.
Valid flags are:
-
0
: Include PolygonMeshPoints, -
1
: Include PolygonMeshUVQFront, -
2
: Include PolygonMeshUVQBack, -
4
: Include PolygonMeshNormals.
Use bitwise OR to combine flags. A value of 7
will include all flags, for example.
496 497 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 496 def mesh(flags = 0) end |
#normal ⇒ Geom::Vector3d
The normal method is used to retrieve the 3D vector normal to the face in the front direction.
520 521 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 520 def normal end |
#outer_loop ⇒ Sketchup::Loop
This method is used to retrieve the outer loop that bounds the face.
543 544 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 543 def outer_loop end |
#plane ⇒ Array(Float, Float, Float, Float)
The plane method is used to retrieve the plane of the face. See the Array class for information on how planes are stored.
567 568 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 567 def plane end |
#position_material(material, pt_array, o_front) ⇒ Sketchup::Face, false
The position_material method is used to position a material on a face.
The pt_array must contain 2, 4, 6 or 8 points. The points are used in pairs to tell where a point in the texture image is positioned on the Face. The first point in each pair is a 3D point in the model. It should be a point on the Face. The second point in each pair of points is a 2D point that gives the (u,v) coordinates of a point in the image to match up with the 3D point.
621 622 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 621 def position_material(material, pt_array, o_front) end |
#pushpull(distance, copy = false) ⇒ nil
The pushpull method is used to perform a push/pull on a face.
The distance is measured in the direction that the face normal is pointing.
653 654 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 653 def pushpull(distance, copy = false) end |
#reverse! ⇒ Sketchup::Face, false
The reverse! method is used to reverse the face’s orientation, meaning the front becomes the back.
677 678 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 677 def reverse! end |
#set_texture_projection(vector, frontside) ⇒ Boolean
This function never worked right. It’s not possible to control the position and orientation of the texture.
The set_texture_projection method is used to set the texture projection direction.
723 724 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 723 def set_texture_projection(vector, frontside) end |
#vertices ⇒ Array<Sketchup::Vertex>
The vertices method is used to get an array of all of the vertices that bound the face.
747 748 |
# File 'lib/sketchup-api-stubs/stubs/Sketchup/Face.rb', line 747 def vertices end |