New to SketchUp; need some guidance on writing a plugin.
-
I was asked to put together some instructions for a feral-cat shelter by the agency I volunteer for, and I thought SketchUp would be perfect. I have some background in drafting, and so I'm treating this as a set of 3D blueprints, as it were.
The problem: I would like to write a tool that allows me to drill holes through a solid or a set of solids, or drill part-way through.
The tentative plan: Create a Drill tool that uses the VCD to accept the bit diameter, and optionally the depth. More about this in a bit. (Edit: No pun intended. Honest.)
This might be a little ambitious for a first plugin, but I've dusted off my Ruby knowledge and I'm gradually picking up the API. The pieces I don't have are: best practices for writing Ruby plugins (how to avoid namespace collisions, whether people prefer plugins grouped by author or not, and so on), how to make a tool cursor that can display the OnFace, OnEdge, Intersection and other such markers (particularly the latter, since I'm trying to make this an easy-to-use precision-capable tool), and how flexibly I can accept input.
The trick: I'd like to be able to drill through a solid (or solids) obliquely, or through a solid (or solids) whose opposing faces are not parallel. Because of this, the push/pull tool will not do. My initial thought was to create a cylinder and intersect it with the shape, removing any geometry that would be "drilled out."
For the sake of precision in future projects, I thought about adding a drill-point angle (defaulting to 118°) for drilling to a specific depth, but then I'm making cones and adding them to cylinders and doing the intersections and trying to figure out what to remove . . . and I'd rather solve the basic problem first (though I would love to solve this, too).
Since I came up with this little learning project, I found that one isn't confined to using the VCD; entire UI panels can be designed. This means that I could (in theory) allow the user to create and keep a library of "drill bits", which could be very useful for these sorts of diagrams. But I don't know what the usual preference is here.
Anybody willing to help me work through this thing?
Thanks.
-
Hi, Welcome,
Browse the Plugins and Developers Forum. Comments come up from time to time about best practices in those threads. You probably have already checked this out. -
hi,
before reinventing the wheel, have you had a look at Tigs http://forums.sketchucation.com/viewtopic.php?t=30846
or sdmitch's http://forums.sketchucation.com/viewtopic.php?t=40172, and I think there's others [in phlatboyz?]...
If they don't do what you need they may be modifiable by you or the author or a collaboration [PM the authors]
It's a good way to learn the 'ways' of SU ruby... although it still eludes me...
john
Advertisement