Ejemplo n.º 1
0
 def create_from_point_vector(normal_vector: Vector, point: Point):
     d = normal_vector.dot(Vector.convert_point(point))
     plane_params = [
         normal_vector.x, normal_vector.y, normal_vector.z,
         mpmath.fneg(d)
     ]
     return Plane(plane_params)
Ejemplo n.º 2
0
 def create_from_3points(points):
     vec_a = Vector.create_from_points(points[0], points[1])
     vec_b = Vector.create_from_points(points[0], points[2])
     normal_vector = vec_a.cross(vec_b)
     d = normal_vector.dot(Vector.convert_point(points[2]))
     plane_params = [
         normal_vector.a, normal_vector.b, normal_vector.c,
         mpmath.fneg(d)
     ]
     return Plane(plane_params)