SketchUp (무료 버전, Mac)에서 간단한 플루트를 만드는 스크립트를 작성하고 있습니다. 튜브를 만들고 튜브를 뚫고 나서 튜브와 실린더 사이에 교차 선을 그려서 실린더를 지우고 튜브에서 자르는 원을 남기고 싶습니다.Sketchup Ruby API를 사용하여 실린더에 구멍을 뚫기
마우스로 조작하면 효과가 있지만 마우스로 배치하고 측정하는 것이 정확하지 않습니다. 지금까지는 스크립트로 작동하지 못했습니다. 현재 튜브에 불완전한 원을 그려 붙어있어 얼굴을 찾아 지울 수 없습니다. 루비 콘솔에서 다음 스크립트를 실행하고 무슨 뜻인지 볼 수 있어야합니다. 내가 도대체 뭘 잘못하고있는 겁니까?
entities = Sketchup.active_model.entities
# make tube
tube = entities.add_group
tube_inner = tube.entities.add_circle Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1), 5, 360
tube_outer = tube.entities.add_circle Geom::Point3d.new(0,0,0), Geom::Vector3d.new(0,0,1), 6, 360
cross_section_face = tube.entities.add_face tube_outer
inner_face = tube.entities.add_face tube_inner
tube.entities.erase_entities inner_face
cross_section_face.pushpull -10, false
# make a cylinder that punches through the wall
hole_punch = entities.add_group
hole_outer = hole_punch.entities.add_circle Geom::Point3d.new(0,0, 5), Geom::Vector3d.new(0,1,0), 3, 360
face = hole_punch.entities.add_face hole_outer
face.pushpull 10, false
# draw the intersection lines and erase the hole punch
entities.intersect_with true, hole_punch.transformation, tube, tube.transformation, true, hole_punch
hole_punch.erase!
나는 그 프로 버전에 대한 방법이 존재한다는 것을 알았지 만 문제는 Sketchup을 사용하여 Sketchup을 사용하여 500 달러를 지불하는 것을 정당화 할 수 없다는 것입니다. – wtbgtr
오 잘. 그것은 실제로 저에게 문제를 해결하지는 않지만 다른 사람들에게는 문제를 해결할 수 있습니다. 그래서 대답을 받아 들일 것입니다. 제안 해 주셔서 감사합니다. – wtbgtr
당신이 시도 할 수있는 대안을 추가했습니다. – thomthom