Коммит d6c19d24 создал по автору Ilya Portnov's avatar Ilya Portnov
Просмотр файлов

Icon.

владелец e4eb7387
......@@ -33,7 +33,7 @@ class SvIntersectNurbsCurvesNode(bpy.types.Node, SverchCustomTreeNode):
bl_idname = 'SvIntersectNurbsCurvesNode'
bl_label = 'Intersect NURBS Curves'
bl_icon = 'OUTLINER_OB_EMPTY'
#sv_icon = 'SV_CONCAT_CURVES'
sv_icon = 'SV_INTERSECT_CURVES'
def get_implementations(self, context):
result = []
......@@ -67,6 +67,12 @@ class SvIntersectNurbsCurvesNode(bpy.types.Node, SverchCustomTreeNode):
default = True,
update = updateNode)
check_intersection : BoolProperty(
name = "Curves do intersect",
description = "If checked, the node will fail when curves do not intersect",
default = False,
update = updateNode)
precision : FloatProperty(
name = "Precision",
default = 0.001,
......@@ -97,6 +103,7 @@ class SvIntersectNurbsCurvesNode(bpy.types.Node, SverchCustomTreeNode):
layout.prop(self, 'implementation', text='')
layout.prop(self, 'matching')
layout.prop(self, 'single')
layout.prop(self, 'check_intersection')
if self.matching == 'CROSS':
layout.prop(self, 'split')
......@@ -187,6 +194,10 @@ class SvIntersectNurbsCurvesNode(bpy.types.Node, SverchCustomTreeNode):
else:
t1s, t2s, ps = self.process_freecad(curve1, curve2)
if self.check_intersection:
if not ps:
raise Exception("Some curves do not intersect!")
if self.single:
if len(ps) >= 1:
ps = ps[0]
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:export-filename="/home/portnov/src/sverchok/ui/icons/sv_intersect_curves.png"
sodipodi:docname="sv_intersect_curves.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
id="svg8"
version="1.1"
viewBox="0 0 16.933333 16.933334"
height="64"
width="64">
<defs
id="defs2">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-8.4666665 : 2.8222223 : 0"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="8.4666665 : 2.8222223 : 0"
inkscape:persp3d-origin="8.4666665 : 5.6444447 : 1"
id="perspective1059" />
<marker
inkscape:isstock="true"
style="overflow:visible"
id="EmptyTriangleOutM"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="EmptyTriangleOutM">
<path
transform="scale(0.4) translate(-4.5,0)"
style="fill-rule:evenodd;fill:#ffffff;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path1069" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker1181"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Lend">
<path
transform="scale(0.8) rotate(180) translate(12.5,0)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path909" />
</marker>
<marker
inkscape:isstock="true"
id="ExperimentalArrow"
refX="5.0"
refY="3.0"
orient="auto-start-reverse"
inkscape:stockid="ExperimentalArrow">
<path
style="fill:context-stroke;stroke:#000000;stroke-opacity:1"
d="m 10,3 -10,3 0,-6 z"
id="path1159" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="EmptyTriangleOutL"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="EmptyTriangleOutL">
<path
transform="scale(0.8) translate(-6,0)"
style="fill-rule:evenodd;fill:#ffffff;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path1066" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="Tail"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Tail">
<g
style="stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(-1.2)"
id="g954">
<path
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-opacity:1;fill-opacity:1"
d="M -3.8048674,-3.9585227 L 0.54352094,0"
id="path942" />
<path
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-opacity:1;fill-opacity:1"
d="M -1.2866832,-3.9585227 L 3.0617053,0"
id="path944" />
<path
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-opacity:1;fill-opacity:1"
d="M 1.3053582,-3.9585227 L 5.6537466,0"
id="path946" />
<path
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-opacity:1;fill-opacity:1"
d="M -3.8048674,4.1775838 L 0.54352094,0.21974226"
id="path948" />
<path
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-opacity:1;fill-opacity:1"
d="M -1.2866832,4.1775838 L 3.0617053,0.21974226"
id="path950" />
<path
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:round;stroke-opacity:1;fill-opacity:1"
d="M 1.3053582,4.1775838 L 5.6537466,0.21974226"
id="path952" />
</g>
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="marker1168"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="TriangleOutS">
<path
transform="scale(0.2)"
style="fill-rule:evenodd;stroke:#a40000;stroke-width:1pt;stroke-opacity:1;fill:#a40000;fill-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path1166" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="TriangleOutS"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="TriangleOutS">
<path
transform="scale(0.2)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path1034" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker1162"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Send">
<path
transform="scale(0.3) rotate(180) translate(-2.3,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
id="path1160" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker1158"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Send">
<path
transform="scale(0.3) rotate(180) translate(-2.3,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
id="path919" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker1155"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Send">
<path
transform="scale(0.2) rotate(180) translate(6,0)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path1153" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker1149"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Send">
<path
transform="scale(0.2) rotate(180) translate(6,0)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path901" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="Arrow2Send"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Send">
<path
transform="scale(0.3) rotate(180) translate(-2.3,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
id="path877" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="Arrow1Send"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Send">
<path
transform="scale(0.2) rotate(180) translate(6,0)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path859" />
</marker>
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0.0"
refX="0.0"
id="marker3098"
style="overflow:visible;"
inkscape:isstock="true">
<path
id="path3096"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.2) rotate(180) translate(6,0)" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="marker9341"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Send">
<path
transform="scale(0.2) rotate(180) translate(6,0)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path9339" />
</marker>
<marker
inkscape:stockid="Arrow1Send"
orient="auto"
refY="0.0"
refX="0.0"
id="marker7727"
style="overflow:visible;"
inkscape:isstock="true">
<path
id="path7725"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.2) rotate(180) translate(6,0)" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="TriangleOutM"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="TriangleOutM">
<path
transform="scale(0.4)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path974" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible"
id="TriangleOutL"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="TriangleOutL">
<path
transform="scale(0.8)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
id="path971" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="Arrow2Lend"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Lend">
<path
transform="scale(1.1) rotate(180) translate(1,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
id="path850" />
</marker>
<marker
inkscape:isstock="true"
style="overflow:visible;"
id="Arrow1Lend"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow1Lend">
<path
transform="scale(0.8) rotate(180) translate(12.5,0)"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
id="path832" />
</marker>
</defs>
<sodipodi:namedview
inkscape:document-rotation="0"
inkscape:snap-global="false"
inkscape:snap-center="true"
showguides="false"
inkscape:window-maximized="1"
inkscape:window-y="24"
inkscape:window-x="0"
inkscape:window-height="1172"
inkscape:window-width="1916"
units="px"
showgrid="false"
inkscape:current-layer="text856"
inkscape:document-units="mm"
inkscape:cy="35.313708"
inkscape:cx="31.368054"
inkscape:zoom="9.4575532"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:lockguides="true">
<inkscape:grid
id="grid4512"
type="xygrid" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-280.06665)"
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
<text
id="text5669"
y="281.8187"
x="0.83109218"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.64583px;line-height:125%;font-family:Sans;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve" />
<g
id="text856"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:18.42996979px;line-height:125%;font-family:Sans;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
aria-label="[]">
<g
id="g1263"
transform="translate(-0.15225443,0.11597167)">
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-rule:evenodd;stroke:#4e9a06;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="M 15.944845,281.15863 C 9.2813319,282.75691 4.7827328,294.70678 1.2929972,295.67606"
id="path1029"
sodipodi:nodetypes="cc" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;fill-rule:evenodd;stroke:#a40000;stroke-width:2.11667;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="M 15.944845,295.67606 C 13.578536,290.29497 5.8525288,283.32898 1.2929972,281.15863"
id="path1258"
sodipodi:nodetypes="cc" />
<ellipse
style="fill:#ffffff;stroke:#000000;stroke-width:0.264583;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:markers fill stroke"
id="circle1041"
cx="8.6189213"
cy="286.57407"
rx="2.0108218"
ry="2.011008" />
</g>
</g>
</g>
</svg>
......@@ -42,6 +42,7 @@ def gordon_surface(u_curves, v_curves, intersections, metric='POINTS', u_knots=N
raise Exception("Some of V-curves are rational. Rational curves are not supported for Gordon surface.")
intersections = np.array(intersections)
print(intersections)
if u_knots is not None:
loft_u_kwargs = loft_v_kwargs = interpolate_kwargs = {'metric': 'POINTS'}
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать