Advertisement
qberik

Untitled

Apr 6th, 2022
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. from zencad import *
  2.  
  3. p_1=[(-6.5,2.045,0),
  4. (-6,0.278,0),
  5. (-5.5,-0.68,0),
  6. (-5,-1.346,0),
  7. (-4.5,-1.85,0),
  8. (-4,-2.248,0),
  9. (-3.5,-2.566,0),
  10. (-3,-2.821,0),
  11. (-2.5,-3.021,0),
  12. (-2,-3.172,0),
  13. (-1.5,-3.276,0),
  14. (-1,-3.338,0),
  15. (-0.5,-3.357,0),
  16. (0,-3.335,0),
  17. (0.5,-3.274,0),
  18. (1,-3.176,0),
  19. (1.5,-3.041,0),
  20. (2,-2.872,0),
  21. (2.5,-2.67,0),
  22. (3,-2.436,0),
  23. (3.5,-2.173,0),
  24. (4,-1.883,0),
  25. (4.5,-1.567,0),
  26. (5,-1.226,0),
  27. (5.5,-0.862,0),
  28. (6,-0.477,0),
  29. (6.5,-0.072,0),
  30. (7,0.351,0),
  31. (7.5,0.792,0),
  32. (8,1.249,0),
  33. (8.5,1.721,0),
  34. (9,2.207,0),
  35. (9.5,2.706,0),
  36. (10,3.217,0),
  37. (10.5,3.74,0),
  38. (11,4.246,0),#
  39. (11.5,4.79,0),
  40. (11,4.704,0),
  41. (10.5,4.412,0),
  42. (10,4.029,0),
  43. (9.5,3.657,0),
  44. (9,3.298,0),
  45. (8.5,2.952,0),
  46. (8,2.621,0),
  47. (7.5,2.305,0),
  48. (7,2.006,0),
  49. (6.5,1.726,0),
  50. (6,1.46,0),
  51. (5.5,1.226,0),
  52. (5,1.009,0),
  53. (4.5,0.816,0),
  54. (4,0.647,0),
  55. (3.5,0.505,0),
  56. (3,0.39,0),
  57. (2.5,0.305,0),
  58. (2,0.249,0),
  59. (1.5,0.223,0),
  60. (1,0.229,0),
  61. (0.5,0.268,0),
  62. (0,0.339,0),
  63. (-0.5,0.444,0),
  64. (-1,0.583,0),
  65. (-1.5,0.757,0),
  66. (-2,0.97,0),
  67. (-2.5,1.224,0),
  68. (-3,1.526,0),
  69. (-3.5,1.884,0),
  70. (-4,2.316,0),
  71. (-4.5,2.848,0),
  72. (-5,3.532,0),
  73. (-5.5,4.485,0),
  74. (-6,3.782,0),#
  75. (-6.5,2.045,0),
  76. ]
  77.  
  78. p_2=[(-6.5,2.211,15),
  79. (-6,0.632,15),
  80. (-5.5,-0.267,15),
  81. (-5,-0.905,15),
  82. (-4.5,-1.395,15),
  83. (-4,-1.79,15),
  84. (-3.5,-2.111,15),
  85. (-3,-2.371,15),
  86. (-2.5,-2.578,15),
  87. (-2,-2.736,15),
  88. (-1.5,-2.856,15),
  89. (-1,-2.909,15),
  90. (-0.5,-2.926,15),
  91. (0,-2.898,15),
  92. (0.5,-2.826,15),
  93. (1,-2.711,15),
  94. (1.5,-2.555,15),
  95. (2,-2.359,15),
  96. (2.5,-2.126,15),
  97. (3,-1.859,15),
  98. (3.5,-1.558,15),
  99. (4,-1.226,15),
  100. (4.5,-0.865,15),
  101. (5,-0.477,15),
  102. (5.5,-0.064,15),
  103. (6,0.373,15),
  104. (6.5,0.832,15),
  105. (7,1.311,15),
  106. (7.5,1.81,15),
  107. (8,2.326,15),
  108. (8.5,2.859,15),
  109. (9,3.39,15),
  110. (9.5,3.93,15),
  111. (10,4.483,15),#
  112. #(10.5,5.02,15),
  113. (10.5,5.351,15),#
  114. (10,5.059,15),
  115. (9.5,4.606,15),
  116. (9,4.165,15),
  117. (8.5,3.736,15),
  118. (8,3.321,15),
  119. (7.5,2.92,15),
  120. (7,2.537,15),
  121. (6.5,2.171,15),
  122. (6,1.824,15),
  123. (5.5,1.499,15),
  124. (5,1.197,15),
  125. (4.5,0.92,15),
  126. (4,0.669,15),
  127. (3.5,0.447,15),
  128. (3,0.256,15),
  129. (2.5,0.097,15),
  130. (2,-0.027,15),
  131. (1.5,-0.116,15),
  132. (1,-0.168,15),
  133. (0.5,-0.182,15),
  134. (0,-0.157,15),
  135. (-0.5,-0.094,15),
  136. (-1,0.008,15),
  137. (-1.5,0.148,15),
  138. (-2,0.325,15),
  139. (-2.5,0.541,15),
  140. (-3,0.796,15),
  141. (-3.5,1.097,15),
  142. (-4,1.452,15),
  143. (-4.5,1.878,15),
  144. (-5,2.409,15),
  145. (-5.5,3.113,15),
  146. (-6,4.173,15),
  147. (-6.5,2.211,15),
  148. ]
  149.  
  150. p_3=[(-6.5,-2.282,35),
  151. (-6,-2.704,35),
  152. (-5.5,-2.986,35),
  153. (-5,-3.159,35),
  154. (-4.5,-3.246,35),
  155. (-4,-3.262,35),
  156. (-3.5,-3.219,35),
  157. (-3,-3.123,35),
  158. (-2.5,-2.982,35),
  159. (-2,-2.801,35),
  160. (-1.5,-2.583,35),
  161. (-1,-2.333,35),
  162. (-0.5,-2.051,35),
  163. (0,-1.741,35),
  164. (0.5,-1.405,35),
  165. (1,-1.045,35),
  166. (1.5,-0.661,35),
  167. (2,-0.256,35),
  168. (2.5,0.171,35),
  169. (3,0.617,35),
  170. (3.5,1.081,35),
  171. (4,1.564,35),
  172. (4.5,2.064,35),
  173. (5,2.58,35),
  174. (5.5,3.112,35),
  175. (6,3.659,35),
  176. (6.5,4.221,35),
  177. (7,4.785,35),
  178. (7.5,5.35,35),
  179. (8,5.825,35),#
  180. (8.5,6.48,35),
  181. #(8.5,6.984,35),
  182. (8,6.353,35),#
  183. (7.5,6.004,35),
  184. (7,5.518,35),
  185. (6.5,5.038,35),
  186. (6,4.564,35),
  187. (5.5,4.098,35),
  188. (5,3.643,35),
  189. (4.5,3.198,35),
  190. (4,2.767,35),
  191. (3.5,2.349,35),
  192. (3,1.947,35),
  193. (2.5,1.561,35),
  194. (2,1.192,35),
  195. (1.5,0.842,35),
  196. (1,0.51,35),
  197. (0.5,0.197,35),
  198. (0,-0.095,35),
  199. (-0.5,-0.368,35),
  200. (-1,-0.621,35),
  201. (-1.5,-0.854,35),
  202. (-2,-1.066,35),
  203. (-2.5,-1.259,35),
  204. (-3,-1.429,35),
  205. (-3.5,-1.575,35),
  206. (-4,-1.693,35),
  207. (-4.5,-1.777,35),
  208. (-5,-1.813,35),
  209. (-5.5,-1.783,35),
  210. (-6.4,-2.068,35),#
  211. (-6.5,-2.282,35),
  212. ]
  213.  
  214. POINTS=points2([p_1,p_2,p_3])
  215.  
  216. ##m=interpolate2(POINTS,degmin=1,degmax=2)
  217. ##m1=fill(interpolate(p_1))
  218. ##m2=fill(interpolate(p_2))
  219. m1=interpolate(p_1)
  220. m2=interpolate(p_2)
  221. m3=interpolate(p_3)
  222. m=loft([m1,m2,m3],smooth=True,shell=False,maxdegree=3)
  223. #disp(m)
  224. ##disp(m1)
  225. ##disp(m2)
  226. nodes,triangles=triangulate(m,0.05)
  227. mm=polyhedron(nodes,triangles)
  228. disp(polyhedron(nodes,triangles))
  229. disp(POINTS,color=color.red)
  230. to_stl(m,'c:/1/02.stl',0.05)
  231.  
  232. show()
  233.  
  234.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement