Spline surface and volume creation with Python API #333
Unanswered
mankatmalte-dev
asked this question in
Q&A
Replies: 1 comment
-
|
I haven't found a way. Tried with The only way this gives me a surface is if points contains 4 points or less. import cadwork
import element_controller as ec
import geometry_controller as gc
import attribute_controller as ac
def main():
line_coordinates = [
[(0,0,0),(0,100,0)],
# [(45.45,0,0),(45.45,90.91,9.09)],
# [(90.91,0,0),(90.91,81.82,18.18)],
# [(136.36,0,0),(136.36,72.73,27.27)],
# [(181.82,0,0),(181.82,63.64,36.36)],
# [(227.27,0,0),(227.27,54.55,45.45)],
# [(272.73,0,0),(272.73,45.45,54.55)],
# [(318.18,0,0),(318.18,36.36,63.64)],
# [(363.64,0,0),(363.64,27.27,72.73)],
# [(409.09,0,0),(409.09,18.18,81.82)],
# [(454.55,0,0),(454.55,9.09,90.91)],
[(500,0,0),(500,0,100)],
]
lines = []
points = []
for line in line_coordinates:
p1 = cadwork.point_3d(line[0][0], line[0][1], line[0][2])
points.append(p1)
p2 = cadwork.point_3d(line[1][0], line[1][1], line[1][2])
points.append(p2)
lines.append(ec.create_line_points(p1, p2))
print(ec.convert_lines_to_surfaces(lines)) # -> this returns []
print(ec.create_surface(points)) # -> this crashes cadwork with more than 4 points
if __name__ == "__main__":
main() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I know it’s possible to create a spline line from points using the API, but I was wondering if it’s also possible to create:
Basically, can this be done through the Python API the same way it can be done directly in Cadwork?
I looked through the API reference but couldn’t find any function or command for this.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions