Adding IntersectingLine Issue #336
|
|
@ -10,7 +10,7 @@
|
|||
<circle cx="5.0" cy="4.0" r="0.05" />
|
||||
<circle cx="4.5" cy="4.5" r="0.05" />
|
||||
</g>
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0045" id="dashed" stroke-dasharray="0.05715 0.028575">
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0045" id="dashed" stroke-dasharray="0.054 0.081">
|
||||
<line x1="5.0" y1="4.0" x2="5.0" y2="4.5" />
|
||||
</g>
|
||||
</g>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 817 B After Width: | Height: | Size: 812 B |
|
|
@ -21,5 +21,12 @@
|
|||
<line x1="1.536548" y1="-0.07943" x2="-1.116266" y2="-1.018127" />
|
||||
<line x1="1.603264" y1="-0.267975" x2="-1.049549" y2="-1.206672" />
|
||||
</g>
|
||||
<g fill="none" stroke="rgb(99,99,99)" stroke-width="0.003893930346632495" id="Hidden" stroke-dasharray="9.9e-05 0.011731">
|
||||
<path d="M -1.086379,0.474208 A 0.1,0.04556501993779891 62.48043841432389 0,0 -1.178789,0.296838" />
|
||||
<path d="M 1.636578,-0.018054 C 1.6342,-0.051046 1.6197,-0.077953 1.523208,-0.114451" />
|
||||
<path d="M 1.523208,-0.114451 C 1.520838,-0.174875 1.576695,-0.282587 1.603264,-0.267975" />
|
||||
<path d="M 1.536548,-0.07943 Q 1.523424,-0.084815 1.523208,-0.114451" />
|
||||
<line x1="1.523208" y1="-0.114451" x2="-1.129605" y2="-1.053148" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.9 KiB |
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<svg width="64.984319mm" height="100.090015mm" viewBox="-0.999608 -1.793481 2.002775 3.08471" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="64.984449mm" height="100.090015mm" viewBox="-0.99961 -1.793481 2.002779 3.08471" 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.0027737422146219284" id="Visible">
|
||||
<path d="M -0.706217,-1.132561 C -0.430488,-1.008513 0.01971,-0.927507 0.3833,-0.901188 C 0.750657,-0.872836 1.006218,-0.896854 1.001778,-0.923979 C 1.007213,-0.951101 0.752612,-0.975263 0.385625,-0.947116 C 0.022428,-0.921 -0.427999,-0.840247 -0.704438,-0.716354 C -0.987851,-0.594017 -1.077991,-0.432823 -0.922581,-0.290919 C -0.776301,-0.148175 -0.394863,-0.030329 0.000521,0.029612 C 0.395893,0.091753 0.777971,0.095982 0.925176,0.075181 C 1.081502,0.055224 0.992492,0.015842 0.709775,0.015207 C 0.434046,0.013019 -0.016152,0.053874 -0.379742,0.149415 C -0.747099,0.242924 -1.00266,0.388803 -0.99822,0.537788 C -1.003655,0.686771 -0.749054,0.832794 -0.382066,0.926507 C -0.01887,1.022252 0.431557,1.06336 0.707996,1.061327 C 0.991409,1.060851 1.081549,1.021517 0.92614,1.001474 C 0.779859,0.980591 0.398421,0.984606 0.003037,1.046525 C -0.392335,1.106245 -0.774413,1.223877 -0.921618,1.366538 C -1.077944,1.508355 -0.988934,1.669598 -0.706217,1.792094" />
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0027737422145410234" id="Visible">
|
||||
<path d="M -0.706217,-1.132561 C -0.4305,-1.008516 0.019718,-0.927505 0.383302,-0.901188 C 0.750653,-0.872837 1.006216,-0.896855 1.001779,-0.923979 C 1.007218,-0.9511 0.752611,-0.975263 0.385622,-0.947117 C 0.022424,-0.921001 -0.427997,-0.840247 -0.704435,-0.716353 C -0.987848,-0.594016 -1.077994,-0.432824 -0.922584,-0.290919 C -0.776302,-0.148175 -0.394858,-0.030328 0.000523,0.029612 C 0.395891,0.091752 0.777967,0.095981 0.925178,0.075181 C 1.08151,0.055226 0.99248,0.015839 0.709775,0.015207 C 0.434058,0.013022 -0.01616,0.053872 -0.379744,0.149415 C -0.747095,0.242925 -1.002657,0.388803 -0.998221,0.537788 C -1.00366,0.68677 -0.749053,0.832794 -0.382064,0.926508 C -0.018866,1.022253 0.431555,1.063359 0.707993,1.061326 C 0.991406,1.06085 1.081552,1.021518 0.926142,1.001474 C 0.77986,0.980591 0.398416,0.984605 0.003035,1.046525 C -0.392332,1.106245 -0.774409,1.223878 -0.92162,1.366538 C -1.077952,1.508354 -0.988922,1.669601 -0.706217,1.792094" />
|
||||
<line x1="0.001779" y1="-1.289841" x2="-0.352219" y2="-1.211201" />
|
||||
<line x1="0.001779" y1="-1.289841" x2="0.354887" y2="-1.211003" />
|
||||
<line x1="0.001779" y1="-1.289841" x2="0.001779" y2="-0.802399" />
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
<line x1="-0.439885" y1="-1.206059" x2="-0.429707" y2="-1.20832" />
|
||||
<line x1="-0.429707" y1="-1.20832" x2="-0.38526" y2="-1.20624" />
|
||||
<line x1="-0.38526" y1="-1.20624" x2="-0.394396" y2="-1.216164" />
|
||||
<line x1="-0.394396" y1="-1.216164" x2="-0.384396" y2="-1.218386" />
|
||||
<line x1="-0.384396" y1="-1.218386" x2="-0.374213" y2="-1.205942" />
|
||||
<line x1="-0.394396" y1="-1.216164" x2="-0.384396" y2="-1.218385" />
|
||||
<line x1="-0.384396" y1="-1.218385" x2="-0.374213" y2="-1.205942" />
|
||||
<line x1="-0.374213" y1="-1.205942" x2="-0.321458" y2="-1.203703" />
|
||||
<line x1="-0.321458" y1="-1.203703" x2="-0.331458" y2="-1.201481" />
|
||||
<line x1="-0.331458" y1="-1.201481" x2="-0.373255" y2="-1.203442" />
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
12
docs/assets/intersecting_line_example.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<svg width="105.09mm" height="205.09mm" viewBox="0.94955 -2.00045 1.0509 2.0509" 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.0009">
|
||||
<line x1="1.0" y1="0.0" x2="2.0" y2="1.0" />
|
||||
<circle cx="1.0" cy="0.0" r="0.05" />
|
||||
</g>
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0009" id="dashed" stroke-dasharray="0.0108 0.0162">
|
||||
<line x1="2.0" y1="0.0" x2="2.0" y2="2.0" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 569 B |
|
|
@ -5,7 +5,7 @@
|
|||
<path d="M 1.0,1.0 A 2.0,2.0 -63.43494882292201 0,1 1.711935,3.980325" />
|
||||
<circle cx="1.0" cy="1.0" r="0.05" />
|
||||
</g>
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.002682292065972528" id="dashed" stroke-dasharray="0.034065 0.017033">
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.002682292065972528" id="dashed" stroke-dasharray="0.032188 0.048281">
|
||||
<line x1="1.0" y1="1.0" x2="1.5" y2="1.25" />
|
||||
</g>
|
||||
</g>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 644 B After Width: | Height: | Size: 644 B |
|
|
@ -5,7 +5,7 @@
|
|||
<line x1="1.0" y1="1.0" x2="2.25" y2="3.165064" />
|
||||
<circle cx="1.0" cy="1.0" r="0.05" />
|
||||
</g>
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0019485571585149866" id="dashed" stroke-dasharray="0.024747 0.012373">
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0019485571585149866" id="dashed" stroke-dasharray="0.023383 0.035074">
|
||||
<line x1="1.0" y1="1.0" x2="3.0" y2="4.464102" />
|
||||
</g>
|
||||
</g>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 626 B |
|
|
@ -6,7 +6,7 @@
|
|||
<circle cx="1.0" cy="1.0" r="0.05" />
|
||||
<circle cx="3.0" cy="3.0" r="0.05" />
|
||||
</g>
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0018" id="dashed" stroke-dasharray="0.02286 0.01143">
|
||||
<g fill="none" stroke="rgb(0,0,0)" stroke-width="0.0018" id="dashed" stroke-dasharray="0.0216 0.0324">
|
||||
<line x1="1.0" y1="1.0" x2="2.0" y2="1.0" />
|
||||
</g>
|
||||
</g>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 617 B |
|
|
@ -111,6 +111,13 @@ The following objects all can be used in BuildLine contexts. Note that
|
|||
+++
|
||||
Helix defined pitch, radius and height
|
||||
|
||||
.. grid-item-card:: :class:`~objects_curve.IntersectingLine`
|
||||
|
||||
.. image:: assets/intersecting_line_example.svg
|
||||
|
||||
+++
|
||||
Intersecting line defined by start, direction & other line
|
||||
|
||||
.. grid-item-card:: :class:`~objects_curve.JernArc`
|
||||
|
||||
.. image:: assets/jern_arc_example.svg
|
||||
|
|
@ -185,6 +192,7 @@ Reference
|
|||
.. autoclass:: EllipticalCenterArc
|
||||
.. autoclass:: FilletPolyline
|
||||
.. autoclass:: Helix
|
||||
.. autoclass:: IntersectingLine
|
||||
.. autoclass:: JernArc
|
||||
.. autoclass:: Line
|
||||
.. autoclass:: PolarLine
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ with BuildLine() as example_5:
|
|||
# [Ex. 5]
|
||||
s = 100 / max(*example_5.line.bounding_box().size)
|
||||
svg = ExportSVG(scale=s)
|
||||
svg.add_layer("dashed", line_type=LineType.DASHED)
|
||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||
svg.add_shape(example_5.line)
|
||||
svg.add_shape(dot.moved(Location(l1 @ 1)))
|
||||
svg.add_shape(dot.moved(Location(l2 @ 1)))
|
||||
|
|
@ -139,7 +139,7 @@ with BuildLine() as jern_arc:
|
|||
JernArc((1, 1), (1, 0.5), 2, 100)
|
||||
s = 100 / max(*jern_arc.line.bounding_box().size)
|
||||
svg = ExportSVG(scale=s)
|
||||
svg.add_layer("dashed", line_type=LineType.DASHED)
|
||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||
svg.add_shape(jern_arc.line)
|
||||
svg.add_shape(dot.moved(Location(Vector((1, 1)))))
|
||||
svg.add_shape(PolarLine((1, 1), 0.5, direction=(1, 0.5)), "dashed")
|
||||
|
|
@ -158,7 +158,7 @@ with BuildLine() as polar_line:
|
|||
PolarLine((1, 1), 2.5, 60)
|
||||
s = 100 / max(*polar_line.line.bounding_box().size)
|
||||
svg = ExportSVG(scale=s)
|
||||
svg.add_layer("dashed", line_type=LineType.DASHED)
|
||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||
svg.add_shape(polar_line.line)
|
||||
svg.add_shape(dot.moved(Location(Vector((1, 1)))))
|
||||
svg.add_shape(PolarLine((1, 1), 4, angle=60), "dashed")
|
||||
|
|
@ -188,7 +188,7 @@ with BuildLine() as radius_arc:
|
|||
RadiusArc((1, 1), (3, 3), 2)
|
||||
s = 100 / max(*radius_arc.line.bounding_box().size)
|
||||
svg = ExportSVG(scale=s)
|
||||
svg.add_layer("dashed", line_type=LineType.DASHED)
|
||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||
svg.add_shape(radius_arc.line)
|
||||
svg.add_shape(dot.moved(Location(Vector((1, 1)))))
|
||||
svg.add_shape(dot.moved(Location(Vector((3, 3)))))
|
||||
|
|
@ -219,7 +219,7 @@ with BuildLine() as tangent_arc:
|
|||
TangentArc((1, 1), (3, 3), tangent=(1, 0))
|
||||
s = 100 / max(*tangent_arc.line.bounding_box().size)
|
||||
svg = ExportSVG(scale=s)
|
||||
svg.add_layer("dashed", line_type=LineType.DASHED)
|
||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||
svg.add_shape(tangent_arc.line)
|
||||
svg.add_shape(dot.moved(Location(Vector((1, 1)))))
|
||||
svg.add_shape(dot.moved(Location(Vector((3, 3)))))
|
||||
|
|
@ -235,7 +235,18 @@ svg.add_shape(dot.moved(Location(Vector((1, 1)))))
|
|||
svg.add_shape(dot.moved(Location(Vector((1.5, 2)))))
|
||||
svg.add_shape(dot.moved(Location(Vector((3, 3)))))
|
||||
svg.write("assets/three_point_arc_example.svg")
|
||||
#
|
||||
|
||||
with BuildLine() as intersecting_line:
|
||||
other = Line((2, 0), (2, 2), mode=Mode.PRIVATE)
|
||||
IntersectingLine((1, 0), (1, 1), other)
|
||||
s = 100 / max(*intersecting_line.line.bounding_box().size)
|
||||
svg = ExportSVG(scale=s)
|
||||
svg.add_layer("dashed", line_type=LineType.ISO_DASH_SPACE)
|
||||
svg.add_shape(other, "dashed")
|
||||
svg.add_shape(intersecting_line.line)
|
||||
svg.add_shape(dot.moved(Location(Vector((1, 0)))))
|
||||
svg.write("assets/intersecting_line_example.svg")
|
||||
show(other, intersecting_line)
|
||||
# show_object(example_1.line, name="Ex. 1")
|
||||
# show_object(example_2.line, name="Ex. 2")
|
||||
# show_object(example_3.line, name="Ex. 3")
|
||||
|
|
|
|||