lsdo_genie.utils.normal_approx

Module Contents

Functions

midpoint_normal_approx(vertices)

Approximate an arbitrary closed polygon by using the midpoints of the edges formed by an input set of vertices

vertex_normal_approx(vertices)

A quick way to approximate the normal vectors from an arbitrary closed polygon.

lsdo_genie.utils.normal_approx.midpoint_normal_approx(vertices: numpy.ndarray)

Approximate an arbitrary closed polygon by using the midpoints of the edges formed by an input set of vertices Normal direction is determined by the direction of the points given in the input: Clockwise : normals point outwards Counter-Clockwise : normals point inwards

Parameters:
verticesnp.ndarray(num_pts,2)

The input points

Returns:
midpoints: np.ndarray(num_pts,2)

Midpoints between input points

normalsnp.ndarray(num_pts,2)

Normal vectors at the midpoints

lsdo_genie.utils.normal_approx.vertex_normal_approx(vertices: numpy.ndarray)

A quick way to approximate the normal vectors from an arbitrary closed polygon. Normals are an average between the 2 edge normals adjacent to a point and follow a covention: Clockwise : normals point outwards Counter-Clockwise : normals point inwards

Parameters:
verticesnp.ndarray(num_pts,2)

The input points

Returns:
normalsnp.ndarray(num_pts,2)

Approximate normal vectors at the input points