Plane
-
Hi Everything,
I didn't understand exactly what the meaning of the array return by the "Face.plane". Means it return 4 values as array format. I want to know because I didn't get any reference for plane in Sketchup. So please help for understanding exactly what is returning from "Face.plane". -
There is no "plane" object in SketchUp, so SketchUp uses an Array. The values are explained in the documentation for the Geom module[1]
@unknownuser said:
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]
[1] http://www.sketchup.com/intl/en/developer/docs/ourdoc/geom
-
As happens too often in the API docs, they give a technically correct but superficial definition and expect you to figure it out on your own. If you care, when a plane is represented as
[Point3d, Vector3d]
The point is a location on the plane, and the vector is the normal to the plane.
When a plane is represented as a four-element array, the first three values are the x,y,z components of the normal vector to the plane, and the fourth value is the distance from the origin to the plane along the normal vector. Face#plane returns this version.
Advertisement