diff --git a/docs/assets/example_blend_curve.svg b/docs/assets/example_blend_curve.svg new file mode 100644 index 0000000..d5e0ce6 --- /dev/null +++ b/docs/assets/example_blend_curve.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/objects.rst b/docs/objects.rst index 8513b2a..0cff926 100644 --- a/docs/objects.rst +++ b/docs/objects.rst @@ -83,6 +83,13 @@ The following objects all can be used in BuildLine contexts. Note that +++ Curve defined by control points and weights + .. grid-item-card:: :class:`~objects_curve.BlendCurve` + + .. image:: assets/example_blend_curve.svg + + +++ + Curve blending curvature of two curves + .. grid-item-card:: :class:`~objects_curve.CenterArc` .. image:: assets/center_arc_example.svg @@ -222,6 +229,7 @@ Reference .. autoclass:: BaseLineObject .. autoclass:: Bezier +.. autoclass:: BlendCurve .. autoclass:: CenterArc .. autoclass:: DoubleTangentArc .. autoclass:: EllipticalCenterArc diff --git a/docs/objects_1d_blend_curve.py b/docs/objects_1d_blend_curve.py new file mode 100644 index 0000000..e7ea991 --- /dev/null +++ b/docs/objects_1d_blend_curve.py @@ -0,0 +1,18 @@ +from build123d import * + +# from ocp_vscode import show_all, set_defaults, Camera + +# set_defaults(reset_camera=Camera.KEEP) + +with BuildLine() as blend_curve: + l1 = CenterArc((0, 0), 5, 135, -135) + l2 = Spline((0, -5), (-3, -8), (0, -11)) + l3 = BlendCurve(l1, l2, tangent_scalars=(2, 5)) +s = 100 / max(*blend_curve.line.bounding_box().size) +svg = ExportSVG(scale=s) +svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE) +svg.add_shape(l1, "dashed") +svg.add_shape(l2, "dashed") +svg.add_shape(l3) +svg.write("assets/example_blend_curve.svg") +# show_all()