mpacts.core. geometrysupport

In order to be able to use this module import it like this:

import mpacts.core.geometrysupport
#or assign it to a shorter name
import mpacts.core.geometrysupport as geo

Ellipse

class mpacts.core.geometrysupport.Ellipse

Bases: mpacts.core.baseobject.BaseObject

The wrapper class for object representing the ellipse in 3D.
Has no default location.
  • Required keywords:
    • a_axis — Unit vector pointing along the first axis.
    • a — Length of the first axis.
    • b_axis — Unit vector pointing along the second axis. Needs to be perpendicular to a_axis.
    • b — Length of the second axis.
    • center — Center of the ellipse.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: a, b, a_axis, b_axis, center
Ellipse(name, parent, **kwargs)
mpacts.core.geometrysupport.distance_ray_sphere((object)arg1, (object)arg2, (object)arg3, (float)arg4) → float :

Computes the distance (along the ray) between a ray and a sphere. Returns -1 if the ray does not intersect with the sphere. The (closest) intersection point can be trivially computed as xray + distance * nray

mpacts.core.geometrysupport.ellipse_intersection_inplane((Ellipse)arg1, (Ellipse)arg2) → object :

Compute intersection between ellipses in a common plane, if there is any.

mpacts.core.geometrysupport.ellipse_intersection_line((Ellipse)arg1, (object)arg2, (object)arg3) → object :

Compute intersection between an ellipse and a line in a common plane, if there is any.

mpacts.core.geometrysupport.intersect_linesegment_quad((object)arg1, (object)arg2, (float)arg3) → object :

Compute the intersection (line, point or empty) between a line segment and a quad.

mpacts.core.geometrysupport.intersect_linesegment_triangle((object)arg1, (object)arg2, (float)arg3) → object :

Compute the intersection (line, point or empty) between a line segment and a triangle.

mpacts.core.geometrysupport.intersect_quad_quad((object)arg1, (object)arg2, (object)arg3) → object :

Compute intersection polygon between two quads in a common plane, if there is any.

mpacts.core.geometrysupport.intersect_quad_triangle((object)arg1, (object)arg2, (object)arg3) → object :

Compute intersection polygon between a quad and a triangle in a common plane, if there is any.

mpacts.core.geometrysupport.intersect_triangle_triangle((object)arg1, (object)arg2, (object)arg3) → object :

Compute intersection polygon between two triangles in a common plane, if there is any.

mpacts.core.geometrysupport.is_point_in_polygon((object)arg1, (object)arg2) → bool :

Checks whether a given sample point is in polygon.

mpacts.core.geometrysupport.is_point_on_line((object)arg1, (object)arg2, (object)arg3) → bool :

Checks whether a given sample point is on a line defined by one point and a vector.

mpacts.core.geometrysupport.normal_triangle((object)arg1, (object)arg2, (object)arg3) → object :

Computes the normal vector (not-unit) for a triangle defined by three points

mpacts.core.geometrysupport.unit_normal_triangle((object)arg1, (object)arg2, (object)arg3) → object :

Computes the unit normal vector for a triangle defined by three points