Class: Geom::Point3d

Inherits:
Object show all
Defined in:
lib/point3d.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePoint3d #initialize(point) ⇒ Point3d #initialize(array) ⇒ Point3d #initialize(x, y, z = 0.0) ⇒ Point3d

Creates a new 3D point.

Overloads:

  • #initializePoint3d

    Creates a point at the origin with all coordinates set to zero.


15
16
# File 'lib/point3d.rb', line 15

def initialize(*args)
end

Class Method Details

.linear_combination(weight1, point1, weight2, point2) ⇒ Geom::Point3d

Creates a new point as a linear combination of two points. This method is generally used to get a point at some percentage along a line connecting the two points. The weights should sum up to 1 if you want to get a on that line. The weights should be between 0 and 1 if you want to get a point between the two points.


109
110
# File 'lib/point3d.rb', line 109

def self.linear_combination(weight1, point1, weight2, point2)
end

Instance Method Details

#+(vector) ⇒ Geom::Point3d

Returns a new point which is offset from the receiver by the given vector.

Examples:

pt = Geom::Point3d.new(1, 2, 3)
pt2 = pt + [1, 1, 1]
==> Point3d(2, 3, 4)

Since:

  • SketchUp 6.0


26
27
# File 'lib/point3d.rb', line 26

def +(vector)
end

#-(vector) ⇒ Geom::Point3d #-(point2) ⇒ Geom::Vector3d

Subtracts from this point.

Overloads:

  • #-(vector) ⇒ Geom::Point3d

    Returns a point that is offset from this point in the opposite direction of the given vector.

  • #-(point2) ⇒ Geom::Vector3d

    Returns a vector from another point to this point.


38
39
# File 'lib/point3d.rb', line 38

def -(vector)
end

#<(point2) ⇒ Boolean

Compare two points coordinate by coordinate. First the x coordinates are compared, if they are equal, the y coordinates are compared, if those are equal finally the z coordinates.

Examples:

pt1 = Geom::Point3d.new(10, 10, 90)
pt2 = Geom::Point3d.new(10, 20, 20)
pt1 < pt2 # ==> true

49
50
# File 'lib/point3d.rb', line 49

def < (point2)
end

#==(point2) ⇒ Boolean

Compare Geom::Point3ds using SketchUp tolerance.


55
56
# File 'lib/point3d.rb', line 55

def ==(point2)
end

#[](index) ⇒ Numeric

Retrieves the coordinate of the point at the specified index.

Raises:

  • IndexError Raised if the index is outside the range [0,2]. Note that negative indices [-3,-1] don't raise.


62
63
# File 'lib/point3d.rb', line 62

def [](index)
end

#[]=(index, value) ⇒ Numeric

Retrieves the coordinate of the point at the specified index.

Raises:

  • IndexError Raised if the index is outside the range [0,2]. Note that negative indices [-3,-1] don't raise.


70
71
# File 'lib/point3d.rb', line 70

def []=(index, value)
end

#cloneGeom::Point3d

Creates another point identical to the point being cloned.


75
76
# File 'lib/point3d.rb', line 75

def clone
end

#distance(point2) ⇒ Length

Compute the distance from this point to another point.


81
82
# File 'lib/point3d.rb', line 81

def distance(point2)
end

#distance_to_line(line) ⇒ Length

Computes the distance from this point to a line.


87
88
# File 'lib/point3d.rb', line 87

def distance_to_line(line)
end

#distance_to_plane(plane) ⇒ Length

Computes the distance from this point to a plane.


93
94
# File 'lib/point3d.rb', line 93

def distance_to_plane(plane)
end

#inspectString

Returns a string containing a human-readable representation of this point.


98
99
# File 'lib/point3d.rb', line 98

def inspect
end

#offset(vector, length = vector.length) ⇒ Geom::Point3d

Offsets a point by a vector and returns a new point. The length of the vector must not be zero.


116
117
# File 'lib/point3d.rb', line 116

def offset(vector, length=vector.length)
end

#offset!(vector, length = vector.length) ⇒ self

Applies an offset by a vector to this point. The length of the vector must not be zero.


123
124
# File 'lib/point3d.rb', line 123

def offset!(vector, length=vector.length)
end

#on_line?(line) ⇒ Boolean

Determines if this point is on a line.


129
130
# File 'lib/point3d.rb', line 129

def on_line?(line)
end

#on_plane?(plane) ⇒ Boolean

Determines if this point is on a plane.


135
136
# File 'lib/point3d.rb', line 135

def on_plane?(plane)
end

#project_to_lineGeom::Point3d

Retrieves the point on a line that is closest to this point.


141
142
# File 'lib/point3d.rb', line 141

def project_to_line
end

#project_to_planeGeom::Point3d

Retrieves the point on a plane that is closest to this point.


147
148
# File 'lib/point3d.rb', line 147

def project_to_plane
end

#set!(x, y = self.x, z = self.y) ⇒ self

Sets the values of this point.


155
156
# File 'lib/point3d.rb', line 155

def set!(x, y=self.x, z=self.y)
end

#to_aArray(Length,Length,Length)

Returns an array representation of this point.


160
161
# File 'lib/point3d.rb', line 160

def to_a
end

#to_sString

Returns a string representation of this point.


165
166
# File 'lib/point3d.rb', line 165

def to_s
end

#transform(transformation) ⇒ Geom::Point3d

Applies a transformation to a copy this point to create a new point.


171
172
# File 'lib/point3d.rb', line 171

def transform(transformation)
end

#transform!(transformation) ⇒ self

Applies a transformation to this point. Unlike the #transform method, the point itself is modified.


178
179
# File 'lib/point3d.rb', line 178

def transform!(transformation)
end

#vector_to(point2) ⇒ Geom::Vector3d

Creates a vector between this point and another point.


184
185
# File 'lib/point3d.rb', line 184

def vector_to(point2)
end

#xLength

Retrieves the x coordinate of this point.


189
190
# File 'lib/point3d.rb', line 189

def x
end

#x=(value) ⇒ Numeric

Sets the x value of this point.


195
196
# File 'lib/point3d.rb', line 195

def x=(value)
end

#yLength

Retrieves the y coordinate of this point.


200
201
# File 'lib/point3d.rb', line 200

def y
end

#y=(value) ⇒ Numeric

Sets the y value of this point.


206
207
# File 'lib/point3d.rb', line 206

def y=(value)
end

#zLength

Retrieves the z coordinate of this point.


211
212
# File 'lib/point3d.rb', line 211

def z
end

#z=(value) ⇒ Numeric

Sets the z value of this point.


217
218
# File 'lib/point3d.rb', line 217

def z=(value)
end