How to find a plane without creating face?

https://ruby.sketchup.com/Geom.html
A plane can be represented as either an Array of a point and a vector, or as an Array of 4 numbers that give the coefficients of a plane equation.

plane1 = [Geom::Point3d.new(0, 0, 0), Geom::Vector3d.new(0, 0, 1)]
plane2 = [0, 0, 1, 0]

Plane (geometry) - Wikipedia
Conversely, it is easily shown that if a , b , c and d are constants and a , b , and c are not all zero, then the graph of the equation:
image

So e.g.:

def plane_as_point_and_vector(plane)
  if plane.length == 2
    return plane
  else
    a, b, c, d = plane
    normal = Geom::Vector3d.new(a,b,c)
    point = ORIGIN.offset(normal.reverse, d)
    return [point, normal]
  end
end

plane_p_v = plane_as_point_and_vector(plane)
plane_normal = plane_p_v[1]
4 Likes