要在 CadQuery 草图中移动到特定位置,使用 .push(cq.Location(...))
完整示例
sketch_move_location.py
import cadquery as cq
# 创建工作平面(用于创建草图的2D坐标系)
wp = cq.Workplane("XY")
# Create sketch
result = wp.sketch().push(cq.Location((1,0.5,0))).rect(1,1).finalize().extrude(0.1)
result # 此行仅用于在cq-editor或jupyter中显示结果如果这篇文章对您有帮助,请考虑请我喝杯咖啡或通过 PayPal 捐款,以支持 TechOverflow 上新文章的研究与发布
