Curves#

Volmdlr curves.

class volmdlr.curves.Circle2D(frame: Frame2D, radius: float, name: str = '')[source]#

Bases: CircleMixin, ClosedCurve

Represents a Circle in two dimensions.

A circle is defined by a coordinate system and a radius. The center of the circle is at the origin of the coordinate system.

The circle is parametrized with polar angles in the interval [0, 2pi). Moving along the circle in the parameter direction corresponds to moving counter-clockwise, following the right-hand rule around the origin of the local coordinate system.

This class inherits from CircleMixin and Curve classes, and provides methods to work with 2D circles.

Parameters:
  • frame (volmdlr.Frame2D) – The 2D frame for the circle.

  • radius (float.) – The radius of the circle.

  • name (str, optional) – The name of the circle. Defaults to ‘’.

arc_intersections(arc2d: Arc2D, abs_tol: float = 1e-06)[source]#

Finds the intersection points between this circle and an arc 2d.

Parameters:
  • arc2d ((edges.Arc2D).) – The arc 2d to find intersections with.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

A list of intersection points between the circle and the arc.

Return type:

List[Point2D].

area()[source]#

Calculates the area for a circle 2d.

Returns:

circle area.

axial_symmetry(line)[source]#

Finds out the symmetric circle 2d according to a line.

property bounding_rectangle#

Gets the bounding rectangle for the circle.

Returns:

bounding rectangle.

bsplinecurve_intersections(bsplinecurve: BSplineCurve2D, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a circle 2d and a BSpline Curve 2D.

Parameters:
  • bsplinecurve – bsplinecurve to search for intersections.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

a list with all intersections between circle and bsplinecurve.

center_of_mass()[source]#

Gets the circle’s center of mass.

circle_intersections(circle: Circle2D)[source]#

Finds the intersection points between this circle and another circle.

Parameters:

circle ((Circle2D).) – The other circle to find intersections with.

Returns:

A list of intersection points between the two circles.

Return type:

List[Point2D].

copy(*args, **kwargs)[source]#

Create a copy of the arc 2d.

Returns:

copied circle 2d.

cut_by_line(line: Line2D)[source]#

Cuts a circle by a line and returns the resulting contours.

Parameters:

line ((Line2D)) – The line used to cut the circle.

Returns:

A list containing the resulting contours after the cut.

Return type:

List[Union[self, Contour2D]]

Raises:

NotImplementedError - If there is only one intersection point, the method is not implemented. ValueError: If there are more than two intersection points, the input is invalid.

ellipse_intersections(ellipse2d: Ellipse2D, abs_tol: float = 1e-07)[source]#

Finds the intersection points between this circle and an arc 2d.

Parameters:
  • ellipse2d ((Ellipse2D).) – The Ellipse 2d to find intersections with.

  • abs_tol – Tolerance.

Returns:

A list of intersection points between the circle and the arc.

Return type:

List[Point2D].

static find_circle_center_from_3_points(point1, point2, point3)[source]#

Finds the center of the circle passing through the three given points.

frame_mapping(frame: Frame2D, side: str)[source]#

Changes frame_mapping and return a new Circle2D.

side = ‘old’ or ‘new’

classmethod from_3_points(point1, point2, point3, is_trigo: bool = True, name: str = '')[source]#

Creates a circle 2d from 3 points.

Returns:

circle 2d.

classmethod from_center_and_radius(center: Point2D, radius: float, is_trigo: bool = True, name: str = '')[source]#

Instantiate a 2D circle using a center and a radius.

Parameters:
  • center (volmdlr.Point2D) – The center point of the circle.

  • radius (float.) – The radius of the circle.

  • is_trigo (bool) – (Optional) If False, the circle is in clockwise direction.

  • name (str, optional) – The name of the circle. Defaults to ‘’.

get_geo_points()[source]#

Represents the circle in 3D space.

hyperbola_intersections(hyperbola2d, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a circle 2d and a Hyperbola 2D.

Parameters:
  • hyperbola2d – hyperbola to search for intersections with.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

a list with all intersections between circle and hyperbola.

is_close(other_circle, abs_tol: float = 1e-06)[source]#

Verifies if two circles are the same, up to given tolerance.

Parameters:
  • other_circle – other_circle.

  • abs_tol – tolerance used

Returns:

property is_trigo#

Return True if circle is counterclockwise.

length()[source]#

Calculates the length of the Circle 2D.

Returns:

the circle’s length.

line_intersections(line2d: Line2D, abs_tol=1e-09)[source]#

Calculates the intersections between a circle 2D and Line 2D.

Parameters:
  • line2d – line to calculate intersections

  • abs_tol – tolerance to consider in calculations.

Returns:

circle and line intersections.

linesegment_intersections(linesegment: LineSegment2D, tol=1e-09)[source]#

Calculates the intersections between a circle 2D and line segment 2D.

Parameters:
  • linesegment – line segment to calculate intersections

  • tol – tolerance to consider in calculations.

Returns:

circle and line segment intersections.

parabola_intersections(parabola2d, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a circle 2d and a Parabola 2D.

Parameters:
  • parabola2d – parabola to search for intersections with.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

a list with all intersections between circle and hyperbola.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Plots the circle using Matplotlib.

plot_data(edge_style: EdgeStyle | None = None, surface_style: SurfaceStyle | None = None)[source]#

Get plot data for the circle 2d.

Parameters:

edge_style (plot_data.EdgeStyle, optional) – Plotting style for the line.

Returns:

Plot data for the line.

Return type:

plot_data.Circle2D

point_belongs(point, tol: float = 1e-06)[source]#

Verifies if a point lies on the Circle 2D.

Parameters:
  • point (volmdlr.Point2D) – A 2D point to check if it is on the Circle 2D.

  • tol – tolerance.

Returns:

True if point is on the circle or false otherwise.

Return type:

bool

point_distance(point)[source]#

Calculates the distance of given point to the circle.

Parameters:

point – point to calculate distance.

Returns:

the distance from the point to the circle 2D.

point_inside(point, tol: float = 1e-06)[source]#

Verifies if a point is inside the Circle 2D.

Parameters:
  • point (volmdlr.Point2D) – A 2D point to check if it is inside the Circle 2D.

  • tol – tolerance.

Returns:

True if point inside the circle or false otherwise.

Return type:

bool

point_symmetric(point)[source]#

Creates a circle symmetrically from a point.

Parameters:

point – symmetry point.

Returns:

Circle 2D symmetric to point.

reverse()[source]#

Gets the circle in the reverse direction.

rotation(center: Point2D, angle: float)[source]#

Circle2D rotation.

Parameters:
  • center – rotation center.

  • angle – angle rotation.

Returns:

a new rotated Circle2D.

second_moment_area(point)[source]#

Second moment area of part of disk.

split(split_start, split_end)[source]#

Splits the current object into two Arc2D edges.

This method creates two Arc2D edges by splitting the current object between the specified start and end points. The new Arc2D edges will connect the split_start and split_end points, and split_end and split_start points respectively.

Parameters:
  • split_start ((Point2D)) – The starting point of the split.

  • split_end ((Point2D)) – The ending point of the split.

Returns:

A list containing the two newly created Arc2D edges resulting from the split.

split_by_line(line: Line2D)[source]#

Split the Circle with a line into two Arc2D.

to_3d(plane_origin, x, y)[source]#

Transforms a Circle2D into an Circle3D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Circle3D.

translation(offset: Vector2D)[source]#

Circle2D translation.

Parameters:

offset – translation vector

Returns:

A new translated Circle2D

class volmdlr.curves.Circle3D(frame: Frame3D, radius: float, name: str = '')[source]#

Bases: CircleMixin, ClosedCurve

Represents a Circle in three dimensions.

A circle is defined by a coordinate system and a radius. The center of the circle is at the origin of the coordinate system, and the z-axis of the coordinate system defines the normal of the circle plane.

The circle is parametrized with polar angles in the interval [0, 2pi). Moving along the circle in the parameter direction corresponds to moving counter-clockwise, following the right-hand rule around the origin of the local coordinate system.

property bounding_box#

Bounding box for Arc 3D.

circle_distance(other_circle, return_points: False)[source]#

Gets the distance between two circles 3D.

Parameters:
  • other_circle – Other circle 3D.

  • return_points – weather to return the corresponding points or not.

Returns:

circle_intersections(other_circle, abs_tol: float = 1e-06)[source]#

Calculates the intersections between two Circle3D.

Parameters:
  • other_circle – Circle 3D to verify intersections.

  • abs_tol – tolerance.

Returns:

list of points intersecting Circle

distance_linesegment(linesegment3d, return_points=False)[source]#

Gets the minimum distance between an Arc 3D and Line Segment 3D.

Parameters:
  • linesegment3d – other line segment 3d.

  • return_points – boolean to decide weather to return the corresponding minimal distance points or not.

Returns:

minimum distance / minimal distance with corresponding points.

ellipse_intersections(ellipse, abs_tol: float = 1e-06)[source]#

Calculates the intersections between two Circle3D.

Parameters:
  • ellipse – Ellipse 3D to verify intersections.

  • abs_tol – tolerance.

Returns:

list of points intersecting Circle

extrusion(extrusion_vector)[source]#

Returns the cylindrical face generated by extrusion of the circle.

frame_mapping(frame: Frame3D, side: str)[source]#

Changes frame_mapping and return a new Circle3D.

side = ‘old’ or ‘new’.

classmethod from_3_points(point1, point2, point3, name: str = '')[source]#

Create a Circle3D object from three points.

This class method constructs a Circle3D object given three 3D points (Point3D objects). The three points are used to uniquely define a circle in 3D space.

Parameters:
  • point1 ((Point3D)) – The first point on the circumference of the circle.

  • point2 ((Point3D)) – The second point on the circumference of the circle.

  • point3 ((Point3D)) – The third point on the circumference of the circle.

  • name – new obejct’s name.

Returns:

A Circle3D object that represents the circle uniquely defined by the three input points.

Raises:
  • ZeroDivisionError – If the three input points are not distinct, a ZeroDivisionError is raised.

  • ZeroDivisionError – If the start, end, and interior points of the arc are not distinct,

a ZeroDivisionError is raised.

classmethod from_center_normal(center: Point3D, normal: Vector3D, radius: float, name: str = '')[source]#

Creates a Circle 3D from a center point and a normal vector, along with is radius.

classmethod from_step(arguments, object_dict, **kwargs)[source]#

Converts a step primitive to a Circle3D.

Parameters:
  • arguments (list) – The arguments of the step primitive.

  • object_dict (dict) – The dictionary containing all the step primitives that have already been instantiated.

Returns:

The corresponding Circle3D object.

Return type:

volmdlr.wires.Circle3D

get_arc_point_angle(point)[source]#

Returns the angle of point on the circle.

is_close(other_circle, abs_tol: float = 1e-06)[source]#

Verifies if two circles are the same, up to given tolerance.

Parameters:
  • other_circle – other_circle.

  • abs_tol – tolerance used

Returns:

length() float[source]#

Calculates the arc length of the circle.

line_intersections(line: Line3D, abs_tol: float = 1e-06)[source]#

Calculates the intersections between the Circle3D and a line 3D.

Parameters:
  • line – line 3D to verify intersections

  • abs_tol – Tolerance.

Returns:

list of points intersecting Circle

linesegment_intersections(linesegment: LineSegment3D, abs_tol: float = 1e-06)[source]#

Calculates the intersections between the Circle3D and a line segment 3D.

Parameters:
  • linesegment – line segment 3D to verify intersections

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

list of points intersecting Circle

property normal#

Gets the circle’s normal.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Plot method for Circle3D.

point_belongs(point: Point3D, abs_tol: float = 1e-06)[source]#

Returns if given point belongs to the Circle3D.

point_distance(point3d)[source]#

Calculates the distance between a Circle 3D and point 3D.

Parameters:

point3d – other point.

Returns:

distance between the two objects.

reverse()[source]#

Reverses the direction of the circle.

revolution(axis_point: Point3D, axis: Vector3D, angle: float)[source]#

Return the Toroidal face generated by the revolution of the circle.

rotation(center: Point3D, axis: Vector3D, angle: float)[source]#

Circle3D rotation.

Parameters:
  • center – rotation center

  • axis – rotation axis

  • angle – angle rotation

Returns:

a new rotated Circle3D

split(split_start, split_end)[source]#

Splits a circle into two arcs, at two given points.

Parameters:
  • split_start – split point 1.

  • split_end – split point 2.

Returns:

A list with two split arc 3D.

sweep(*args)[source]#

Circle 3D is used as path for sweeping given section through it.

Returns:

to_2d(plane_origin, x, y)[source]#

Transforms a Circle3D into an Circle2D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Circle2D.

to_step(current_id, *args, **kwargs)[source]#

Exports the circle 3d to STEP.

translation(offset: Vector3D)[source]#

Circle3D translation.

Parameters:

offset – translation vector

Returns:

A new translated Circle3D

class volmdlr.curves.CircleMixin[source]#

Bases: object

Circle abstract class.

abscissa(point: Point3D, tol: float = 1e-06)[source]#

Calculates the abscissa a given point.

Parameters:
  • point – point to calculate abscissa.

  • tol – tolerance.

Returns:

abscissa

property center#

Gets circle’s center point.

discretization_points(*, number_points: int | None = None, angle_resolution: int = 20)[source]#

Discretize a Circle to have “n” points.

Parameters:
  • number_points – the number of points (including start and end points) if unset, only start and end will be returned

  • angle_resolution – if set, the sampling will be adapted to have a controlled angular distance. Useful to mesh an arc

Returns:

a list of sampled points

point_at_abscissa(curvilinear_abscissa)[source]#

Start point is at intersection of frame.u axis.

split_at_abscissa(abscissa)[source]#

Splits a Circle into two at a given fraction of its length (abscissa parameter).

Parameters:

abscissa (float.) – The fraction of the circle length at which to perform the split. Value should be between 0.0 and circle.length(), where 0.0 represents the start of the circle and circle.length() represents the end of the arc.

Returns:

A list containing the two split Arc objects.

Return type:

List[Arc].

Raises:

ValueError - If the abscissa value is outside the valid range [0.0, circle length].

trim(point1: Point2D | Point3D, point2: Point2D | Point3D, same_sense: bool = True, abs_tol: float = 1e-06)[source]#

Trims a circle between two points.

Parameters:
  • point1 – point 1 used to trim circle.

  • point2 – point2 used to trim circle.

  • same_sense – Used for periodical curves only. Indicates whether the curve direction agrees with (True) or is in the opposite direction (False) to the edge direction. By default, it’s assumed True

  • abs_tol – tolerance between points to consider a full arc.

Returns:

arc between these two points.

class volmdlr.curves.ClosedCurve(name: str = '')[source]#

Bases: Curve

Abstract class for defining closed curves (Circle, Ellipse) properties.

length()[source]#

Calculates the Closed Curve’s length.

local_discretization(point1, point2, number_points: int = 10)[source]#

Gets n discretization points between two given points of the Curve.

Parameters:
  • point1 – point 1 on edge.

  • point2 – point 2 on edge.

  • number_points – number of points to discretize locally.

Returns:

list of locally discretized points.

property periodic#

Returns True if the curve is closed.

point_at_abscissa(abscissa)[source]#

Returns the point that corresponds to the given abscissa.

Parameters:

abscissa (float) – The abscissa

Returns:

The point that corresponds to the given abscissa.

Return type:

Union[volmdlr.Point2D, volmdlr.Point3D]

class volmdlr.curves.ConicMixin[source]#

Bases: object

Abstract class for Conic curves.

circle_intersections(circle, abs_tol: float = 1e-06)[source]#

Gets intersections between a Conic and Circle 3D.

Parameters:
  • circle – Other Circle 3D.

  • abs_tol – tolerance.

Returns:

A list of points, containing all intersections between the Conic 3D and the circle 3D.

ellipse_intersections(ellipse, abs_tol: float = 1e-06)[source]#

Gets intersections between a Conic and Ellipse 3D.

Parameters:
  • ellipse – Other Ellipse 3D.

  • abs_tol – tolerance.

Returns:

A list of points, containing all intersections between the Ellipse 3D and the Conic 3D.

line_intersections(line, abs_tol: float = 1e-06)[source]#

Gets intersections between a Conic 3D and a Line 3D.

Parameters:
  • line – Other Line 3D.

  • abs_tol – tolerance.

Returns:

A list of points, containing all intersections between the Line 3D and the Hyperbola3D.

class volmdlr.curves.Curve(name: str = '')[source]#

Bases: DessiaObject

Abstract class for a curve object.

abscissa(point)[source]#

Calculate the abscissa of a point on the curve.

intersections(other_curve, abs_tol: float = 1e-06)[source]#

Gets the intersections between two curves.

Parameters:
  • other_curve – other curve.

  • abs_tol – tolerance.

Returns:

list of intersection points.

length()[source]#

Return Curve’s length.

line_intersections(line, abs_tol: float = 1e-06)[source]#

Calculate the line_intersections between line and curve.

linesegment_intersections(linesegment, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a curve and a Line Segment.

Parameters:
  • linesegment – the Line Segment.

  • abs_tol – tolerance.

:return:a list containing all intersections between the two objects, if any exists.

property periodic#

Returns True if the curve is closed.

sort_points_along_curve(points: List[Point2D | Point3D])[source]#

Sort point along a curve.

Parameters:

points – list of points to be sorted.

Returns:

sorted points.

class volmdlr.curves.Ellipse2D(major_axis, minor_axis, frame, name='')[source]#

Bases: EllipseMixin, ClosedCurve

Defines an Ellipse in two-dimensions.

Ellipse2D defined by a major axis (A), minor axis (B), a center and a frame 2d where its u-component represents the direction of the major axis.

Parameters:
  • major_axis (float) – ellipse’s major axis (A)

  • minor_axis (float) – ellipse’s minor axis (B)

  • frame (volmdlr.Frame2D.) – ellipse’s local frame.

Example:

>>> ellipse2d = Ellipse2D(4, 2, volmdlr.OXY)
abscissa(point: Point2D, tol: float = 1e-06)[source]#

Calculates the abscissa for a given point.

Parameters:
  • point – point to calculate the abscissa.

  • tol – tolerance.

Returns:

the corresponding abscissa, 0 < abscissa < ellipse’s length.

area()[source]#

Calculates the ellipse’s area.

Returns:

ellipse’s area, float.

property bounding_rectangle#

Gets the bounding rectangle of the ellipse 2d.

Returns:

a Bounding Rectangle object.

discretization_points(*, number_points: int | None = None, angle_resolution: int = 20)[source]#

Calculates the discretized points for the ellipse.

Parameters:
  • number_points – number of point to have in the discretized points.

  • angle_resolution – the angle resolution to be used to discretize points.

Returns:

discretized points.

ellipse_intersections(ellipse2d, abs_tol: float = 1e-07)[source]#

Gets the intersections between two Ellipse 2D.

Parameters:
  • ellipse2d – The other ellipse.

  • abs_tol – Tolerance.

Returns:

frame_mapping(frame: Frame2D, side: str)[source]#

Changes frame_mapping and return a new Ellipse2D.

side = ‘old’ or ‘new’.

hyperbola_intersections(hyperbola2d, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a circle 2d and a Hyperbola 2D.

Parameters:
  • hyperbola2d – hyperbola to search for intersections with.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

a list with all intersections between circle and hyperbola.

is_close(other_ellipse2d, abs_tol: float = 1e-06)[source]#

Verifies if two ellipse are the same, up to given tolerance.

Parameters:
  • other_ellipse2d – other ellipse.

  • abs_tol – tolerance used

Returns:

line_intersections(line: Line2D, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a line and an ellipse.

Parameters:
  • line – line to calculate intersections.

  • abs_tol – tolerance.

Returns:

list of points intersections, if there are any

linesegment_intersections(linesegment: LineSegment2D, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a line segment and an ellipse.

Parameters:
  • linesegment – line segment to calculate intersections.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

list of points intersections, if there are any.

parabola_intersections(parabola2d, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a circle 2d and a Hyperbola 2D.

Parameters:
  • parabola2d – parabola to search for intersections with.

  • abs_tol – tolerance to be considered while validating an intersection.

Returns:

a list with all intersections between circle and hyperbola.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Matplotlib plot for an ellipse.

point_angle_with_major_dir(point2d)[source]#

Given a point in the ellipse, calculates it angle with the major direction vector.

point_at_abscissa(abscissa)[source]#

Get a point at given abscissa.

point_belongs(point, abs_tol=0.01)[source]#

Verifies if a point is on the ellipse.

Parameters:
  • point – point to be verified.

  • abs_tol – tolerance (0.99 should be considered True).

Returns:

True or False.

point_distance(point)[source]#

Calculates the distance between an Ellipse 2d and point 2d.

Parameters:

point (volmdlr.Point3D.) – Other point to calculate distance.

Returns:

The distance between ellipse and point

Return type:

float.

point_inside(point, abs_tol: float = 0.01)[source]#

Verifies if a point is inside ellipse.

Parameters:
  • point – point to be verified.

  • abs_tol – tolerance (0.99 should be considered True).

Returns:

True or False.

point_over_contour(point, abs_tol=1e-06)[source]#

Verifies if a point is on the ellipse.

Parameters:
  • point – point to be verified.

  • abs_tol – tolerance.

Returns:

True or False.

reverse()[source]#

Reverses the direction of the Ellipse.

rotation(center, angle: float)[source]#

Rotation of ellipse around a center and an angle.

Parameters:
  • center – center of the rotation.

  • angle – angle to rotated of.

Returns:

a rotated new ellipse.

to_3d(plane_origin, x, y)[source]#

Transforms a Ellipse2D into an Ellipse3D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Ellipse3D.

translation(offset: Vector2D)[source]#

Translation of ellipse from an offset vector.

Parameters:

offset – corresponding translation vector.

Returns:

translated new ellipse 2d.

class volmdlr.curves.Ellipse3D(major_axis: float, minor_axis: float, frame, name: str = '')[source]#

Bases: ConicMixin, EllipseMixin, ClosedCurve

Represents a 3D ellipse.

An ellipse is defined by a coordinate system, a major and minor axis. The center of the ellipse is at the origin of the coordinate system. The major axis is parallel to the local x-axis, and the minor axis is parallel to the local y-axis. The parameter domain of an ellipse is [0, 2*pi]. Moving along the ellipse in the parameter direction corresponds to moving counter-clockwise, following the right-hand rule, around the origin of the local coordinate system

Parameters:
  • major_axis (float) – Largest radius of the ellipse

  • minor_axis (float) – The Smallest radius of the ellipse

  • frame – frame 3d where the ellipse is located.

abscissa(point: Point3D, tol: float = 1e-06)[source]#

Calculates the abscissa a given point.

Parameters:
  • point – point to calculate abscissa.

  • tol – tolerance.

Returns:

abscissa

property bounding_box#

Bounding box for Arc 3D.

discretization_points(*, number_points: int | None = None, angle_resolution: int = 20)[source]#

Discretize a Contour to have “n” points.

Parameters:
  • number_points – the number of points (including start and end points) if unset, only start and end will be returned.

  • angle_resolution – if set, the sampling will be adapted to have a controlled angular distance. Useful to mesh an arc.

Returns:

a list of sampled points.

ellipse_intersections(ellipse, abs_tol: float = 1e-06)[source]#

Gets intersections between an Ellipse 3D and a Line3D.

Parameters:
  • ellipse – Other Ellipse 3D.

  • abs_tol – tolerance.

Returns:

A list of points, containing all intersections between the two Ellipse3D.

frame_mapping(frame: Frame3D, side: str)[source]#

Changes frame_mapping and return a new Ellipse3D.

side = ‘old’ or ‘new’.

classmethod from_step(arguments, object_dict, **kwargs)[source]#

Converts a step primitive to a Ellipse3D.

Parameters:
  • arguments (list) – The arguments of the step primitive.

  • object_dict (dict) – The dictionary containing all the step primitives that have already been instantiated.

Returns:

The corresponding Ellipse3D object.

Return type:

volmdlr.wires.Ellipse3D

is_close(other_ellipse3d, abs_tol: float = 1e-06)[source]#

Verifies if two ellipse are the same, up to given tolerance.

Parameters:
  • other_ellipse3d – other ellipse.

  • abs_tol – tolerance used

Returns:

linesegment_intersections(linesegment, abs_tol: float = 1e-06)[source]#

Gets intersections between an Ellipse 3D and a Line3D.

Parameters:
  • linesegment – Other Line 3D.

  • abs_tol – tolerance.

Returns:

A list of points, containing all intersections between the Line 3D and the Ellipse3D.

property normal#

Gets ellipse’s normal vector.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Plots an ellipse using Matplotlib.

point_at_abscissa(abscissa: float)[source]#

Calculates the 3D point on the curve at a given fraction of its length (abscissa).

Parameters:

abscissa ((float)) – The fraction of the curve’s length at which to calculate the point.

Returns: The calculated 3D point on the curve. :rtype: Point3D.

point_belongs(point, tol: float = 1e-06)[source]#

Verifies if a given point lies on the Ellipse3D.

Parameters:
  • point – point to be verified.

  • tol – tolerance.

Returns:

True is point lies on the Ellipse, False otherwise

reverse()[source]#

Reverses the direction of the Ellipse.

rotation(center: Point3D, axis: Vector3D, angle: float)[source]#

Ellipse3D rotation.

Parameters:
  • center – rotation center.

  • axis – rotation axis.

  • angle – angle rotation.

Returns:

a new rotated Ellipse3D.

property self_2d#

Version 2d of the ellipse 3d as a property.

to_2d(plane_origin, x, y)[source]#

Transforms an Ellipse 3D into an Ellipse 2D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Ellipse2D.

to_step(current_id, *args, **kwargs)[source]#

Exports the circle 3d to STEP.

translation(offset: Vector3D)[source]#

Ellipse 3D translation.

Parameters:

offset – translation vector.

Returns:

A new translated Ellipse 3D.

trim(point1: Point3D, point2: Point3D, same_sense: bool = True, abs_tol: float = 1e-06)[source]#

Trims an ellipse between two points.

Parameters:
  • point1 – point1 used to trim ellipse.

  • point2 – point2 used to trim ellipse.

  • same_sense – indicates whether the curve direction agrees with (True) or is in the opposite direction (False) to the edge direction. By default, it’s assumed True

  • abs_tol – tolerance between points to consider a full arc of ellipse.

Returns:

arc of ellipse between these two points.

class volmdlr.curves.EllipseMixin[source]#

Bases: object

Ellipse abstract class.

property center#

Gets ellipse’s center point.

length()[source]#

Calculates the length of the ellipse.

Ramanujan’s approximation for the perimeter of the ellipse. P = π (a + b) [ 1 + (3h) / (10 + √(4 - 3h) ) ], where h = (a - b)**2/(a + b)**2 :return:

property major_dir#

Gets ellipse’s major direction vector.

property minor_dir#

Gets ellipse’s minor direction vector.

class volmdlr.curves.Hyperbola2D(frame: Frame2D, semi_major_axis, semi_minor_axis, name: str = '')[source]#

Bases: HyperbolaMixin

Class for Hyperbola 2D.

Parameters:
  • frame – 2D frame where the hyperbola is at.

  • semi_major_axis – hyperbola’s semi major axis.

  • semi_minor_axis – hyperbola’s semi minor axis.

frame_mapping(frame: Frame2D, side: str)[source]#

Changes frame_mapping and return a new Hyperbola2D.

side = ‘old’ or ‘new’.

get_dx_dy(point)[source]#

Gets the dx/dy at a given point of the hyperbola 2d.

Parameters:

point – the other point.

Returns:

the dx/dy slope at given point.

get_points(min_y: float | None = None, max_y: float | None = None, number_points: int = 30)[source]#

Gets hyperbola positive branch points.

Parameters:
  • number_points – number of point to be generated.

  • min_y – y-minimal value.

  • max_y – y-maximal value.

Returns:

a List of 2D points for the hyperbola positive branch.

line_intersections(line: Line2D, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a Hyperbola and an infinite Line in 2D.

Parameters:
  • line – the infinite 2d line.

  • abs_tol – tolerance.

:return:a list containing all intersections between the two objects, if any exists.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Matplotlib plot for a hyperbola in 2D.

Parameters:
  • ax – Matplotlib 2D axes.

  • edge_style – the Styles to be applied to the Hyperbola.

Returns:

Matplotlib 2D axes.

point_belongs(point, abs_tol: float = 1e-06)[source]#

Verifies if point belongs to the Hyperbola.

Parameters:
  • point – other point.

  • abs_tol – tolerance.

Returns:

True if point belongs, and False otherwise.

tangent(point)[source]#

Calculates the tangent vector to a hyperbola at a given point.

Parameters:

point (volmdlr.Point2D.) – The point at which the tangent vector is to be calculated.

Returns:

The tangent vector to the hyperbola at the given point.

Return type:

volmdlr.Vector2D.

class volmdlr.curves.Hyperbola3D(frame: Frame3D, semi_major_axis, semi_minor_axis, name: str = '')[source]#

Bases: ConicMixin, HyperbolaMixin

Class for Hyperbola 3D.

Parameters:
  • frame – 3D frame where the hyperbola is at.

  • semi_major_axis – hyperbola’s semi major axis.

  • semi_minor_axis – hyperbola’s semi minor axis.

frame_mapping(frame: Frame3D, side: str)[source]#

Changes frame_mapping and return a new Hyperbola3D.

side = ‘old’ or ‘new’.

get_points(min_y: float | None = None, max_y: float | None = None, number_points: int = 30)[source]#

Gets hyperbola positive branch points.

Parameters:
  • number_points – number of point to be generated.

  • min_y – y-minimal value.

  • max_y – y-maximal value.

Returns:

a List of 3D points for the hyperbola positive branch.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Matplotlib plot for a hyperbola in 3D.

Parameters:
  • ax – Matplotlib 3D axes.

  • edge_style – the Styles to be applied to the Hyperbola.

Returns:

Matplotlib 3D axes.

point_belongs(point, tol: float = 1e-06)[source]#

Verifies if a given point lies on the Hyperbola 3D.

Parameters:
  • point – point to be verified.

  • tol – tolerance.

Returns:

True is point lies on the Hyperbola 3D, False otherwise

property self_2d#

Version 2d of the ellipse 3d as a property.

sort_points_along_curve(points: List[Point2D | Point3D])[source]#

Sort point along a curve.

Parameters:

points – list of points to be sorted.

Returns:

sorted points.

tangent(point)[source]#

Calculates the tangent vector to a hyperbola at a given point.

Parameters:

point (volmdlr.Point3D.) – The point at which the tangent vector is to be calculated.

Returns:

The tangent vector to the hyperbola at the given point.

Return type:

volmdlr.Vector3D.

to_2d(plane_origin, x, y)[source]#

Transforms a Hyperbola 3D into a Hyperbola 2D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Hyperbola2D.

class volmdlr.curves.HyperbolaMixin(frame: Frame2D | Frame3D, semi_major_axis: float, semi_minor_axis: float, name: str = '')[source]#

Bases: Curve

Abstract class for a Hyperbola.

get_x(y)[source]#

For given y component, get the corresponding hyperbola x component, in local coordinates.

Parameters:

y – y component.

Returns:

x component.

is_close(other, abs_tol: float = 1e-06)[source]#

Verifies if two Hyperbolas are the same, up to given tolerance.

Parameters:
  • other – other hyperbola.

  • abs_tol – tolerance used

Returns:

linesegment_intersections(linesegment, abs_tol: float = 1e-06)[source]#

Calculates the intersections between a Hyperbola and a Line Segment.

Parameters:
  • linesegment – the Line Segment.

  • abs_tol – tolerance.

:return:a list containing all intersections between the two objects, if any exists.

trim(point1, point2)[source]#

Trims a hyperbola between two points.

Parameters:
  • point1 – point 1 used to trim circle.

  • point2 – point2 used to trim circle.

class volmdlr.curves.Line(point1, point2, name='')[source]#

Bases: Curve

Abstract class representing a line.

Parameters:
  • point1 (Union[volmdlr.Point2D, volmdlr.Point3D]) – The first point defining the line

  • point2 (Union[volmdlr.Point2D, volmdlr.Point3D]) – The second point defining the line

  • name (str, optional) – Name of the line. Default value is an empty string

abscissa(point)[source]#

Calculate the abscissa of a point on the line.

Parameters:

point (Union[volmdlr.Point2D, volmdlr.Point3D]) – The point for which to calculate the abscissa

Returns:

The abscissa of the point

Return type:

float

closest_point_on_line(point)[source]#

Gets point on the line closest to given point.

Parameters:

point – Other point.

direction_vector(*args, **kwargs)[source]#

Get the direction vector of the line.

Returns:

The direction vector of the line

Return type:

Union[volmdlr.Vector2D, volmdlr.Vector3D]

classmethod from_point_and_vector(point: Point2D | Point3D, direction_vector: Vector2D | Vector3D, name: str = '')[source]#

Creates a Line object using only a point and a direction vector.

Parameters:
  • point – line’s origin point.

  • direction_vector – line’s direction vector.

  • name – line’s name.

Returns:

is_between_points(point1: Point2D | Point3D, point2: Point2D | Point3D)[source]#

Verifies if a line is between two points.

Parameters:
  • point1 (Union[volmdlr.Point2D, volmdlr.Point3D]) – The first point

  • point2 (Union[volmdlr.Point2D, volmdlr.Point3D]) – The second point

Returns:

True if the line is between the two points, False otherwise

Return type:

bool

is_close(other_line, abs_tol: float = 1e-06)[source]#

Verfies if two Lines are the same, considering a certain tolerance.

Parameters:
  • other_line – other line.

  • abs_tol – tolerance used.

Returns:

True or False.

normal_vector(*args, **kwargs)[source]#

Get the normal vector of the line.

Returns:

The normal vector of the line

Return type:

Union[volmdlr.Vector2D, volmdlr.Vector3D]

point_at_abscissa(abscissa)[source]#

Returns the point that corresponds to the given abscissa.

Parameters:

abscissa (float) – The abscissa

Returns:

The point that corresponds to the given abscissa.

Return type:

Union[volmdlr.Point2D, volmdlr.Point3D]

point_projection(point)[source]#

Calculate the projection of a point onto the line.

Parameters:

point (Union[volmdlr.Point2D, volmdlr.Point3D]) – The point to project

Returns:

The projection of the point onto the line and the distance between the point and the projection

Return type:

Tuple(Union[volmdlr.Point2D, volmdlr.Point3D], float)

reverse()[source]#

Gets a line in the reverse direction.

split(split_point)[source]#

Split a line into two lines.

Parameters:

split_point (Union[volmdlr.Point2D, volmdlr.Point3D]) – The point where to split the line

Returns:

A list containing two lines

to_step(current_id, *args, **kwargs)[source]#

Exports to STEP format.

trim(point1: Point3D, point2: Point3D, **kwargs)[source]#

Trims a line creating a line segment.

Parameters:
  • point1 – line segment start.

  • point2 – line segment end.

  • same_sense – Used for periodical curves only. Indicates whether the curve direction agrees with (True) or is in the opposite direction (False) to the edge direction. By default, it’s assumed True

Returns:

line segment.

unit_direction_vector(*args, **kwargs)[source]#

Get the unit direction vector of the line.

Returns:

The unit direction vector of the line

Return type:

Union[volmdlr.Vector2D, volmdlr.Vector3D]

unit_normal_vector(*args, **kwargs)[source]#

Get the unit normal vector of the line.

Returns:

The unit normal vector of the line

Return type:

Union[volmdlr.Vector2D, volmdlr.Vector3D]

class volmdlr.curves.Line2D(point1: Point2D, point2: Point2D, *, name='')[source]#

Bases: Line

Define an infinite line given by two points in 2D.

create_tangent_circle(point, other_line)[source]#

Computes the two circles that are tangent to 2 lines and intersect a point located on one of the two lines.

frame_mapping(frame: Frame2D, side: str)[source]#

Map the line to a new coordinate frame.

Parameters:
  • frame (volmdlr.Frame2D) – The new coordinate frame.

  • side (str) – The side to which the mapping is made. ‘old’ for the original coordinate frame, ‘new’ for the new one.

Returns:

The mapped line.

Return type:

Line2D

get_slope()[source]#

Gets the line’s slope.

get_y_intersection()[source]#

Gets the intersection of the 2D line with the Y axis.

Returns:

y-intersection value.

line_distance(other_line)[source]#

Calculates the distance between infinite Lines in 2D.

Parameters:

other_line – other line.

Returns:

distance between line and line segment.

line_intersections(line, abs_tol: float = 1e-06)[source]#

Calculate the intersection between the two lines.

Parameters:
  • line (volmdlr.Line2D.) – The line to calculate intersections with.

  • abs_tol – tolerance.

Returns:

A list of at most one intersection point between the two lines.

Return type:

List[volmdlr.Point2D]

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Plot the line.

Parameters:
  • ax (matplotlib.axes._subplots.AxesSubplot, optional) – Matplotlib axis on which to plot the line. If none, a new figure is created.

  • edge_style – data class instance, containing all parameters needed to plot Line 2D.

Returns:

The Matplotlib axis.

Return type:

matplotlib.axes._subplots.AxesSubplot

plot_data(edge_style=None)[source]#

Get plot data for the line.

Parameters:

edge_style (plot_data.EdgeStyle, optional) – Plotting style for the line.

Returns:

Plot data for the line.

Return type:

plot_data.Line2D

point_belongs(point2d, abs_tol: float = 1e-06)[source]#

Verifies if the point 2D belongs to the line.

Parameters:
  • point2d – point to be verified.

  • abs_tol – absolute tolerance to consider in calculus.

Returns:

True if point belongs to line, False otherwise.

point_distance(point2d)[source]#

Calculate the shortest distance between a line and a point.

Parameters:

point2d (volmdlr.Point2D.) – Point to calculate distance.

Returns:

Distance to point.

Return type:

float.

rotation(center: Point2D, angle: float)[source]#

Line2D rotation.

Parameters:
  • center – rotation center.

  • angle – angle rotation.

Returns:

a new rotated Line2D.

to_3d(plane_origin, x1, x2)[source]#

Convert the line to a 3D line.

Parameters:
  • plane_origin (volmdlr.Point3D) – Origin of the plane in which the line is.

  • x1 (volmdlr.Vector3D) – First direction of the plane in which the line is.

  • x2 (volmdlr.Vector3D) – Second direction of the plane in which the line is.

Returns:

The 3D line.

Return type:

Line3D

translation(offset: Vector2D)[source]#

Line2D translation.

Parameters:

offset – translation vector.

Returns:

A new translated Line2D.

class volmdlr.curves.Line3D(point1: Point3D, point2: Point3D, name: str = '')[source]#

Bases: Line

Define an infinite line passing through the 2 points.

property bounding_box#

Bounding Box getter.

copy(*args, **kwargs)[source]#

Creates a Copy of Line3D and returns it.

frame_mapping(frame: Frame3D, side: str)[source]#

Changes vector frame_mapping and return a new Line3D.

side = ‘old’ or ‘new’

classmethod from_step(arguments, object_dict, **kwargs)[source]#

Converts a step primitive to an Line3D.

Parameters:
  • arguments (list) – The arguments of the step primitive.

  • object_dict (dict) – The dictionary containing all the step primitives that have already been instantiated

Returns:

The corresponding Line3D object

Return type:

Line3D

intersection(line2, tol: float = 1e-06)[source]#

Calculates the intersection between two Line3D, if there is an intersection.

Parameters:
  • line2 – other Line3D

  • tol – maximum tolerance.

Returns:

None if there is no intersection between Lines.

A volmdlr.Point3D if there exists an intersection.

line_distance(line2)[source]#

Calculates the distance between two Line3D.

Parameters:

line2 – other Line3D.

Returns:

The distance between the two lines.

line_intersections(line, abs_tol: float = 1e-06)[source]#

Gets the intersection between two Line3D, if there is an intersection.

Parameters:
  • line – other Line3D.

  • abs_tol – tolerance.

Returns:

None if there is no intersection between Lines.

A volmdlr.Point3D if there exists an intersection.

minimum_distance_points(other_line)[source]#

Returns the points on this line and the other line that are the closest of lines.

plane_projection2d(center, x, y)[source]#

Project the 3D line onto a 2D plane defined by the center point and two orthogonal vectors, x and y.

Parameters:
  • center – The center point of the plane.

  • x – A tuple representing the first orthogonal vector (x-component, y-component, z-component).

  • y – A tuple representing the second orthogonal vector (x-component, y-component, z-component).

Returns:

A new 2D line resulting from the projection of the current 3D line onto the specified plane.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True), length: float = 1.0)[source]#

Plot method for Line 3D using Matplotlib.

point_belongs(point3d, tol: float = 1e-06)[source]#

Verifies if a point belongs to the Line 3D.

Parameters:
  • point3d – point to be verified.

  • tol – tolerance.

Returns:

returns True if point belongs to the line, and False otherwise.

point_distance(point)[source]#

Returns the minimal distance to a point.

rotation(center: Point3D, axis: Vector3D, angle: float)[source]#

Line3D rotation.

Parameters:
  • center – rotation center

  • axis – rotation axis

  • angle – angle rotation

Returns:

a new rotated Line3D

skew_to(line)[source]#

Verifies if two Line3D are skew to each other, that is, they are not parallel and never intersect.

Parameters:

line – other line.

Returns:

True if they are skew, False otherwise.

to_2d(plane_origin, x, y)[source]#

Transforms a Line3D into an Line2D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Line2D.

translation(offset: Vector3D)[source]#

Line3D translation.

Parameters:

offset – translation vector

Returns:

A new translated Line3D

class volmdlr.curves.Parabola2D(frame, focal_length: float, name: str = '')[source]#

Bases: ParabolaMixin

Class for a Parabola in 2D.

Parameters:
  • frame (Frame2D.) – 2D frame where the Parabola will be at. The parabola Opens int the frame.v direction.

  • focal_length (float.) – the parabola’s focal length.

get_points(min_x: float | None = None, max_x: float | None = None, number_points: int = 30)[source]#

Gets parabola points.

Parameters:
  • number_points – number of point to be generated.

  • min_x – x-minimal value.

  • max_x – x-maximal value.

Returns:

a List of 2D points.

line_intersections(line: Line2D, abs_tol: float = 1e-06)[source]#

Gets intersections between a Parabola 2D and a Line 2D.

Parameters:
  • line – Other Line 2D.

  • abs_tol – tolerance.

Returns:

A list of points, containing all intersections between the Line 2D and the Parabola 2D.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Matplotlib plot for a parabola in 2D.

Parameters:
  • ax – Matplotlib 2D axes.

  • edge_style – the Styles to be applied to the Parabola.

Returns:

Matplotlib 2D axes.

point_belongs(point, abs_tol: float = 1e-06)[source]#

Verifies if point belongs to the Parabola.

Parameters:
  • point – other point.

  • abs_tol – tolerance.

Returns:

True if point belongs, and False otherwise.

tangent(point)[source]#

Calculates the tangent vector to a parabola at a given point.

Parameters:

point (volmdlr.Point2D.) – The point at which the tangent vector is to be calculated.

Returns:

The tangent vector to the ellipse at the given point.

Return type:

volmdlr.Vector2D.

class volmdlr.curves.Parabola3D(frame: Frame3D, focal_length: float, name: str = '')[source]#

Bases: ConicMixin, ParabolaMixin

Class for a Parabola in 3D.

Parameters:
  • frame (Frame3D.) – 3D frame where the Parabola will be at. The parabola Opens int the frame.v direction.

  • focal_length (float.) – the parabola’s focal length.

frame_mapping(frame: Frame3D, side: str)[source]#

Changes frame_mapping and return a new Hyperbola3D.

side = ‘old’ or ‘new’.

get_points(min_x: float | None = None, max_x: float | None = None, number_points: int = 30)[source]#

Gets parabola 3D points.

Parameters:
  • number_points – number of point to be generated.

  • min_x – x-minimal value.

  • max_x – x-maximal value.

Returns:

a List of 3D points.

plot(ax=None, edge_style: EdgeStyle = EdgeStyle(color='k', alpha=1, edge_ends=False, edge_direction=False, width=None, arrow=False, plot_points=False, dashed=True, linestyle='-', linewidth=1, equal_aspect=True))[source]#

Matplotlib plot for a parabola in 3D.

Parameters:
  • ax – Matplotlib 3D axes.

  • edge_style – the Styles to be applied to the Parabola.

Returns:

Matplotlib 3D axes.

point_belongs(point, tol: float = 1e-06)[source]#

Verifies if a given point lies on the Hyperbola 3D.

Parameters:
  • point – point to be verified.

  • tol – tolerance.

Returns:

True is point lies on the Hyperbola 3D, False otherwise

property self_2d#

Version 2d of the ellipse 3d as a property.

sort_points_along_curve(points: List[Point2D | Point3D])[source]#

Sort point along a curve.

Parameters:

points – list of points to be sorted.

Returns:

sorted points.

tangent(point)[source]#

Calculates the tangent vector to a parabola at a given point.

Parameters:

point (volmdlr.Point3D.) – The point at which the tangent vector is to be calculated.

Returns:

The tangent vector to the parabola at the given point.

Return type:

volmdlr.Vector3D.

to_2d(plane_origin, x, y)[source]#

Transforms a Parabola 3D into a Parabola 2D, given a plane origin and an u and v plane vector.

Parameters:
  • plane_origin – plane origin.

  • x – plane u vector.

  • y – plane v vector.

Returns:

Parabola2D.

class volmdlr.curves.ParabolaMixin(name: str = '')[source]#

Bases: Curve

Abstract class for Parabola.

get_y(x)[source]#

Evaluate the y-coordinate of the parabola at a given x-coordinate.

Parameters:

x (float.) – The x-coordinate of the point.

Return float:

The y-coordinate of the point on the parabola.

is_close(other, abs_tol: float = 1e-06)[source]#

Verifies if two Parabolas are the same, up to given tolerance.

Parameters:
  • other – other parabola.

  • abs_tol – tolerance used

Returns:

trim(point1, point2)[source]#

Trims a Parabola between two points.

Parameters:
  • point1 – point 1 used to trim circle.

  • point2 – point2 used to trim circle.

volmdlr.curves.hyperbola_parabola_control_point_and_weight(start, start_tangent, end, end_tangent, point)[source]#

Gets control points and weights for hyperbola and parabola curves represented by bsplines.