mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Create doc svgs. Replace DoubleTangentArc svg to use spline instead of arc.
This commit is contained in:
parent
7e33864e8e
commit
1a062724c7
6 changed files with 113 additions and 11 deletions
|
|
@ -1,13 +1,13 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<svg width="40.09mm" height="101.09mm" viewBox="-0.01125 -25.01125 10.0225 25.2725" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
<svg width="100.089998mm" height="102.589998mm" viewBox="-0.0045 -10.0045 10.009 10.259" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g transform="scale(1,-1)" stroke-linecap="round">
|
<g transform="scale(1,-1)" stroke-linecap="round">
|
||||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0225">
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.00900000018">
|
||||||
<path d="M 6.0,0.0 A 47.000000000000085,47.000000000000085 180.0 0,0 9.615385,18.076923" />
|
<path d="M 6.0,0.0 A 11.022002852739636,11.022002852739636 0.0 0,1 1.242,9.069003" />
|
||||||
<circle cx="6.0" cy="0.0" r="0.25" />
|
<circle cx="6.0" cy="0.0" r="0.25" />
|
||||||
</g>
|
</g>
|
||||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0225" id="dashed" stroke-dasharray="0.27 0.405">
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.00900000018" id="dashed" stroke-dasharray="0.108 0.162">
|
||||||
<path d="M 0.0,20.0 A 5.0,5.0 180.0 1,0 2.5,15.669873" />
|
<path d="M 0.0,10.0 C 2.605146,7.884615 8.294029,4.391384 10.0,10.0" />
|
||||||
<line x1="6.0" y1="0.0" x2="6.0" y2="5.0" />
|
<line x1="6.0" y1="0.0" x2="6.0" y2="1.0" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 680 B After Width: | Height: | Size: 708 B |
12
docs/assets/example_arc_arc_tangent_arc.svg
Normal file
12
docs/assets/example_arc_arc_tangent_arc.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<svg width="100.09mm" height="100.09mm" viewBox="-0.0045 -10.0045 10.009 10.009" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="scale(1,-1)" stroke-linecap="round">
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.008999999999999998">
|
||||||
|
<path d="M 0.098274,9.997584 A 12.0,12.0 87.18351331597553 0,0 9.497124,4.66264" />
|
||||||
|
</g>
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.008999999999999998" id="dashed" stroke-dasharray="0.108 0.162">
|
||||||
|
<circle cx="7.0" cy="3.0" r="3.0" />
|
||||||
|
<path d="M -0.0,6.0 A 2.0,2.0 0.0 0,1 0.0,10.0" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 639 B |
12
docs/assets/example_arc_arc_tangent_line.svg
Normal file
12
docs/assets/example_arc_arc_tangent_line.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<svg width="100.09mm" height="100.09mm" viewBox="-0.0045 -10.0045 10.009 10.009" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="scale(1,-1)" stroke-linecap="round">
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.009">
|
||||||
|
<line x1="8.448109" y1="5.627352" x2="0.965406" y2="9.751568" />
|
||||||
|
</g>
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.009" id="dashed" stroke-dasharray="0.108 0.162">
|
||||||
|
<circle cx="7.0" cy="3.0" r="3.0" />
|
||||||
|
<path d="M -0.0,6.0 A 2.0,2.0 0.0 0,1 0.0,10.0" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 590 B |
13
docs/assets/example_point_arc_tangent_arc.svg
Normal file
13
docs/assets/example_point_arc_tangent_arc.svg
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<svg width="102.59mm" height="100.09mm" viewBox="-0.0045 -10.0045 10.259 10.009" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="scale(1,-1)" stroke-linecap="round">
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.009000000000000001">
|
||||||
|
<path d="M 10.0,3.0 A 10.575383789062535,10.575383789062535 -108.43494882292202 0,0 4.283756,7.578649" />
|
||||||
|
<circle cx="10.0" cy="3.0" r="0.25" />
|
||||||
|
</g>
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.009000000000000001" id="dashed" stroke-dasharray="0.108 0.162">
|
||||||
|
<path d="M -0.0,0.0 A 5.0,5.0 0.0 0,1 0.0,10.0" />
|
||||||
|
<line x1="10.0" y1="3.0" x2="9.051317" y2="3.316228" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 725 B |
12
docs/assets/example_point_arc_tangent_line.svg
Normal file
12
docs/assets/example_point_arc_tangent_line.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<svg width="102.59mm" height="100.09mm" viewBox="-0.0045 -10.0045 10.259 10.009" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g transform="scale(1,-1)" stroke-linecap="round">
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.009000000000000001">
|
||||||
|
<line x1="10.0" y1="3.0" x2="3.25848" y2="8.792401" />
|
||||||
|
<circle cx="10.0" cy="3.0" r="0.25" />
|
||||||
|
</g>
|
||||||
|
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.009000000000000001" id="dashed" stroke-dasharray="0.108 0.162">
|
||||||
|
<path d="M -0.0,0.0 A 5.0,5.0 0.0 0,1 0.0,10.0" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 612 B |
|
|
@ -176,7 +176,6 @@ svg.write("assets/polyline_example.svg")
|
||||||
|
|
||||||
with BuildLine(Plane.YZ) as filletpolyline:
|
with BuildLine(Plane.YZ) as filletpolyline:
|
||||||
FilletPolyline((0, 0, 0), (0, 10, 2), (0, 10, 10), (5, 20, 10), radius=2)
|
FilletPolyline((0, 0, 0), (0, 10, 2), (0, 10, 10), (5, 20, 10), radius=2)
|
||||||
show(filletpolyline)
|
|
||||||
scene = Compound(filletpolyline.line) + Compound.make_triad(2)
|
scene = Compound(filletpolyline.line) + Compound.make_triad(2)
|
||||||
visible, _hidden = scene.project_to_viewport((0, 0, 1), (0, 1, 0))
|
visible, _hidden = scene.project_to_viewport((0, 0, 1), (0, 1, 0))
|
||||||
s = 100 / max(*Compound(children=visible).bounding_box().size)
|
s = 100 / max(*Compound(children=visible).bounding_box().size)
|
||||||
|
|
@ -248,17 +247,71 @@ svg.add_shape(dot.moved(Location(Vector((1, 0)))))
|
||||||
svg.write("assets/intersecting_line_example.svg")
|
svg.write("assets/intersecting_line_example.svg")
|
||||||
|
|
||||||
with BuildLine() as double_tangent:
|
with BuildLine() as double_tangent:
|
||||||
l2 = JernArc(start=(0, 20), tangent=(0, 1), radius=5, arc_size=-300)
|
p1 = (6, 0)
|
||||||
l3 = DoubleTangentArc((6, 0), tangent=(0, 1), other=l2)
|
d1 = (0, 1)
|
||||||
|
l2 = Spline((0, 10), (3, 8), (7, 7), (10, 10))
|
||||||
|
show_object([p1, l2])
|
||||||
|
l3 = DoubleTangentArc(p1, tangent=d1, other=l2)
|
||||||
s = 100 / max(*double_tangent.line.bounding_box().size)
|
s = 100 / max(*double_tangent.line.bounding_box().size)
|
||||||
svg = ExportSVG(scale=s)
|
svg = ExportSVG(scale=s)
|
||||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||||
svg.add_shape(l2, "dashed")
|
svg.add_shape(l2, "dashed")
|
||||||
svg.add_shape(l3)
|
svg.add_shape(l3)
|
||||||
svg.add_shape(dot.scale(5).moved(Pos(6, 0)))
|
svg.add_shape(dot.scale(5).moved(Pos(p1)))
|
||||||
svg.add_shape(Edge.make_line((6, 0), (6, 5)), "dashed")
|
svg.add_shape(PolarLine(p1, 1, direction=d1), "dashed")
|
||||||
svg.write("assets/double_tangent_line_example.svg")
|
svg.write("assets/double_tangent_line_example.svg")
|
||||||
|
|
||||||
|
with BuildLine() as point_arc_tangent_line:
|
||||||
|
p1 = (10, 3)
|
||||||
|
l1 = CenterArc((0, 5), 5, -90, 180)
|
||||||
|
l2 = PointArcTangentLine(p1, l1, Side.RIGHT)
|
||||||
|
s = 100 / max(*point_arc_tangent_line.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)
|
||||||
|
svg.add_shape(dot.scale(5).moved(Pos(p1)))
|
||||||
|
svg.write("assets/example_point_arc_tangent_line.svg")
|
||||||
|
|
||||||
|
with BuildLine() as point_arc_tangent_arc:
|
||||||
|
p1 = (10, 3)
|
||||||
|
d1 = (-3, 1)
|
||||||
|
l1 = CenterArc((0, 5), 5, -90, 180)
|
||||||
|
l2 = PointArcTangentArc(p1, d1, l1, Side.RIGHT)
|
||||||
|
s = 100 / max(*point_arc_tangent_arc.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)
|
||||||
|
svg.add_shape(dot.scale(5).moved(Pos(p1)))
|
||||||
|
svg.add_shape(PolarLine(p1, 1, direction=d1), "dashed")
|
||||||
|
svg.write("assets/example_point_arc_tangent_arc.svg")
|
||||||
|
|
||||||
|
with BuildLine() as arc_arc_tangent_line:
|
||||||
|
l1 = CenterArc((7, 3), 3, 0, 360)
|
||||||
|
l2 = CenterArc((0, 8), 2, -90, 180)
|
||||||
|
l3 = ArcArcTangentLine(l1, l2, Side.RIGHT, Keep.OUTSIDE)
|
||||||
|
s = 100 / max(*arc_arc_tangent_line.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_arc_arc_tangent_line.svg")
|
||||||
|
|
||||||
|
with BuildLine() as arc_arc_tangent_arc:
|
||||||
|
l1 = CenterArc((7, 3), 3, 0, 360)
|
||||||
|
l2 = CenterArc((0, 8), 2, -90, 180)
|
||||||
|
radius = 12
|
||||||
|
l3 = ArcArcTangentArc(l1, l2, radius, Side.LEFT, Keep.OUTSIDE)
|
||||||
|
s = 100 / max(*arc_arc_tangent_arc.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_arc_arc_tangent_arc.svg")
|
||||||
|
|
||||||
# show_object(example_1.line, name="Ex. 1")
|
# show_object(example_1.line, name="Ex. 1")
|
||||||
# show_object(example_2.line, name="Ex. 2")
|
# show_object(example_2.line, name="Ex. 2")
|
||||||
# show_object(example_3.line, name="Ex. 3")
|
# show_object(example_3.line, name="Ex. 3")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue