Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
vmax = surfaces[3]
wmin = surfaces[4]
wmax = surfaces[5]
vol1 = edge_surfaces(umin,umax)
vol2 = edge_surfaces(vmin,vmax)
vol3 = edge_surfaces(wmin,wmax)
vol4 = Volume(controlpoints=vol1.corners(order='F'), rational=vol1.rational)
vol1.swap(0, 2)
vol1.swap(1, 2)
vol2.swap(1, 2)
vol4.swap(1, 2)
Volume.make_splines_identical(vol1, vol2)
Volume.make_splines_identical(vol1, vol3)
Volume.make_splines_identical(vol1, vol4)
Volume.make_splines_identical(vol2, vol3)
Volume.make_splines_identical(vol2, vol4)
Volume.make_splines_identical(vol3, vol4)
result = vol1.clone()
result.controlpoints += vol2.controlpoints
result.controlpoints += vol3.controlpoints
result.controlpoints -= 2*vol4.controlpoints
return result
else:
raise ValueError('Requires two or six input surfaces')
umax = surfaces[1]
vmin = surfaces[2]
vmax = surfaces[3]
wmin = surfaces[4]
wmax = surfaces[5]
vol1 = edge_surfaces(umin,umax)
vol2 = edge_surfaces(vmin,vmax)
vol3 = edge_surfaces(wmin,wmax)
vol4 = Volume(controlpoints=vol1.corners(order='F'), rational=vol1.rational)
vol1.swap(0, 2)
vol1.swap(1, 2)
vol2.swap(1, 2)
vol4.swap(1, 2)
Volume.make_splines_identical(vol1, vol2)
Volume.make_splines_identical(vol1, vol3)
Volume.make_splines_identical(vol1, vol4)
Volume.make_splines_identical(vol2, vol3)
Volume.make_splines_identical(vol2, vol4)
Volume.make_splines_identical(vol3, vol4)
result = vol1.clone()
result.controlpoints += vol2.controlpoints
result.controlpoints += vol3.controlpoints
result.controlpoints -= 2*vol4.controlpoints
return result
else:
raise ValueError('Requires two or six input surfaces')
# coons patch (https://en.wikipedia.org/wiki/Coons_patch)
umin = surfaces[0]
umax = surfaces[1]
vmin = surfaces[2]
vmax = surfaces[3]
wmin = surfaces[4]
wmax = surfaces[5]
vol1 = edge_surfaces(umin,umax)
vol2 = edge_surfaces(vmin,vmax)
vol3 = edge_surfaces(wmin,wmax)
vol4 = Volume(controlpoints=vol1.corners(order='F'), rational=vol1.rational)
vol1.swap(0, 2)
vol1.swap(1, 2)
vol2.swap(1, 2)
vol4.swap(1, 2)
Volume.make_splines_identical(vol1, vol2)
Volume.make_splines_identical(vol1, vol3)
Volume.make_splines_identical(vol1, vol4)
Volume.make_splines_identical(vol2, vol3)
Volume.make_splines_identical(vol2, vol4)
Volume.make_splines_identical(vol3, vol4)
result = vol1.clone()
result.controlpoints += vol2.controlpoints
result.controlpoints += vol3.controlpoints
result.controlpoints -= 2*vol4.controlpoints
return result
else:
raise ValueError('Requires two or six input surfaces')
wmin = surfaces[4]
wmax = surfaces[5]
vol1 = edge_surfaces(umin,umax)
vol2 = edge_surfaces(vmin,vmax)
vol3 = edge_surfaces(wmin,wmax)
vol4 = Volume(controlpoints=vol1.corners(order='F'), rational=vol1.rational)
vol1.swap(0, 2)
vol1.swap(1, 2)
vol2.swap(1, 2)
vol4.swap(1, 2)
Volume.make_splines_identical(vol1, vol2)
Volume.make_splines_identical(vol1, vol3)
Volume.make_splines_identical(vol1, vol4)
Volume.make_splines_identical(vol2, vol3)
Volume.make_splines_identical(vol2, vol4)
Volume.make_splines_identical(vol3, vol4)
result = vol1.clone()
result.controlpoints += vol2.controlpoints
result.controlpoints += vol3.controlpoints
result.controlpoints -= 2*vol4.controlpoints
return result
else:
raise ValueError('Requires two or six input surfaces')
umin = surfaces[0]
umax = surfaces[1]
vmin = surfaces[2]
vmax = surfaces[3]
wmin = surfaces[4]
wmax = surfaces[5]
vol1 = edge_surfaces(umin,umax)
vol2 = edge_surfaces(vmin,vmax)
vol3 = edge_surfaces(wmin,wmax)
vol4 = Volume(controlpoints=vol1.corners(order='F'), rational=vol1.rational)
vol1.swap(0, 2)
vol1.swap(1, 2)
vol2.swap(1, 2)
vol4.swap(1, 2)
Volume.make_splines_identical(vol1, vol2)
Volume.make_splines_identical(vol1, vol3)
Volume.make_splines_identical(vol1, vol4)
Volume.make_splines_identical(vol2, vol3)
Volume.make_splines_identical(vol2, vol4)
Volume.make_splines_identical(vol3, vol4)
result = vol1.clone()
result.controlpoints += vol2.controlpoints
result.controlpoints += vol3.controlpoints
result.controlpoints -= 2*vol4.controlpoints
return result
else:
raise ValueError('Requires two or six input surfaces')
vmin = surfaces[2]
vmax = surfaces[3]
wmin = surfaces[4]
wmax = surfaces[5]
vol1 = edge_surfaces(umin,umax)
vol2 = edge_surfaces(vmin,vmax)
vol3 = edge_surfaces(wmin,wmax)
vol4 = Volume(controlpoints=vol1.corners(order='F'), rational=vol1.rational)
vol1.swap(0, 2)
vol1.swap(1, 2)
vol2.swap(1, 2)
vol4.swap(1, 2)
Volume.make_splines_identical(vol1, vol2)
Volume.make_splines_identical(vol1, vol3)
Volume.make_splines_identical(vol1, vol4)
Volume.make_splines_identical(vol2, vol3)
Volume.make_splines_identical(vol2, vol4)
Volume.make_splines_identical(vol3, vol4)
result = vol1.clone()
result.controlpoints += vol2.controlpoints
result.controlpoints += vol3.controlpoints
result.controlpoints -= 2*vol4.controlpoints
return result
else:
raise ValueError('Requires two or six input surfaces')