aerocaps.geom.curves.Line3D#
- class Line3D(p0: ~aerocaps.geom.point.Point3D, p1: ~aerocaps.geom.point.Point3D = None, theta: ~aerocaps.units.angle.Angle = None, phi: ~aerocaps.units.angle.Angle = None, d: ~aerocaps.units.length.Length = <aerocaps.units.length.Length object>, name: str = 'Line3D', construction: bool = False)[source]#
Bases:
PCurve3DThree-dimensional line class
- __init__(p0: ~aerocaps.geom.point.Point3D, p1: ~aerocaps.geom.point.Point3D = None, theta: ~aerocaps.units.angle.Angle = None, phi: ~aerocaps.units.angle.Angle = None, d: ~aerocaps.units.length.Length = <aerocaps.units.length.Length object>, name: str = 'Line3D', construction: bool = False)[source]#
- Parameters:
p0
p1
theta
phi
d
name (str) – Name of the geometric object. May be re-assigned a unique name when added to a
GeometryContainer. Default: ‘Line3D’construction (bool) – Whether this is a geometry used only for construction of other geometries. If
True, this geometry will not be exported or plotted. Default:False
Methods
d2cdt2(t)Evaluates the second derivative of the curve with respect to \(t\)
dcdt(t)Evaluates the first derivative of the curve with respect to \(t\)
evaluate(t)Evaluates the line at one or more \(t\)-values
Evaluates a verbose set of parametric curve data as a class based on an input parameter value or vector
Evaluates the line at one or more \(t\)-values and returns a single point object or list of point objects
get_control_point_array([unit])Gets an array representation of the two points defining the line.
Gets a vector object determined by the starting and ending points of the line
plot([plot, ax, nt])Plots the line on either a 3-D
matplotlib.pyplot.Axesproject_onto_principal_plane([plane])Projects the line onto a principal plane
reverse()Creates a copy of the line with the parametric direction reversed
to_iges(*args, **kwargs)Converts the geometric object to an IGES entity.
transform(**transformation_kwargs)Creates a transformed copy of the curve by transforming the start and end points
Attributes
- d2cdt2(t: float) ndarray[source]#
Evaluates the second derivative of the curve with respect to \(t\)
- Parameters:
t (float or int or numpy.ndarray) – Either a single \(t\)-value, a number of evenly spaced \(t\)-values between 0 and 1, or a 1-D array of \(t\)-values
- Returns:
If \(t\) is a
float, the output is a 1-D array containing three elements: the \(x\)- \(y\)-, and \(z\)-components of the second derivative. Otherwise, the output is a 2-D array of size \(\text{len}(t) \times 3\)- Return type:
- dcdt(t: float) ndarray[source]#
Evaluates the first derivative of the curve with respect to \(t\)
- Parameters:
t (float or int or numpy.ndarray) – Either a single \(t\)-value, a number of evenly spaced \(t\)-values between 0 and 1, or a 1-D array of \(t\)-values
- Returns:
If \(t\) is a
float, the output is a 1-D array containing two elements: the \(x\)- \(y\), and \(z\)-components of the first derivative. Otherwise, the output is a 2-D array of size \(\text{len}(t) \times 3\)- Return type:
- evaluate(t: float) ndarray[source]#
Evaluates the line at one or more \(t\)-values
- Parameters:
t (float or int or numpy.ndarray) – Either a single \(t\)-value, a number of evenly spaced \(t\)-values between 0 and 1, or a 1-D array of \(t\)-values
- Returns:
If
tis afloat, the output is a 1-D array with three elements: the values of \(x\), \(y\), and \(x\). Otherwise, the output is an array of size \(\text{len}(t) \times 3\)- Return type:
- evaluate_pcurvedata(t: float) PCurveData3D[source]#
Evaluates a verbose set of parametric curve data as a class based on an input parameter value or vector
- Parameters:
t (float or int or numpy.ndarray) – Either a single \(t\)-value, a number of evenly spaced \(t\)-values between 0 and 1, or a 1-D array of \(t\)-values
- Returns:
Parametric curve information, including derivative and curvature data
- Return type:
- evaluate_point3d(t: float) Point3D[source]#
Evaluates the line at one or more \(t\)-values and returns a single point object or list of point objects
- Parameters:
t (float or int or numpy.ndarray) – Either a single \(t\)-value, a number of evenly spaced \(t\)-values between 0 and 1, or a 1-D array of \(t\)-values
- Returns:
If
tis afloat, the output is a single point object. Otherwise, the output is a list of point objects- Return type:
- get_control_point_array(unit: str = 'm') ndarray[source]#
Gets an array representation of the two points defining the line. Used for compatibility with NURBS curve methods.
- Parameters:
unit (str) – Physical length units used to create the array from the point objects
- Returns:
Array of size \(2 \times 3\)
- Return type:
- get_vector() Vector3D[source]#
Gets a vector object determined by the starting and ending points of the line
- Returns:
Vector object
- Return type:
- plot(plot: Plotter = None, ax: Axes = None, nt: int = 10, **kwargs)[source]#
Plots the line on either a 3-D
matplotlib.pyplot.Axes- Parameters:
plot (pyvista.Plotter) – 3-D
pyvistaplotting windowax (plt.Axes) – Axis on which to plot the line
nt (int) – Number of points along the line to output to the plot. Default:
10kwargs – Additional keyword arguments to pass to
matplotlib.pyplot.Axes.plotorpyvista.Plotter.add_lines
- project_onto_principal_plane(plane: str = 'XY') Line2D[source]#
Projects the line onto a principal plane
- reverse() Line3D[source]#
Creates a copy of the line with the parametric direction reversed
- Returns:
Reversed line
- Return type:
- to_iges(*args, **kwargs) IGESEntity[source]#
Converts the geometric object to an IGES entity. To add this IGES entity to an
.igsfile, use anIGESGenerator.
- transform(**transformation_kwargs) Line3D[source]#
Creates a transformed copy of the curve by transforming the start and end points
- Parameters:
transformation_kwargs – Keyword arguments passed to
Transformation3D- Returns:
Transformed line
- Return type: