Follow

For many projects I now consider code to be the superior tool for CAD work.

However...

As they say, one of the hardest problems in programming is giving names to things. Quite often I find myself trying to think of a name for a variable like thickness_of_the_piece_that_goes_down_the_side_of_that_weird_angled_cutout_of_the_connector_minus_some_tiny_offset_for_clearance

@jhol If in doubt use single letter variable names.

Actually in this situation, my "tiny offset for clearance" is usually called dr (delta-radius) and the various "thicknesses" get called t1, t2, t3 in order. "t" is a general purpose border/spacer. Same with "w" for widths, "l" for lengths, x,y,z for coordinate positions, etc.

@jhol ...and then you should definitely use functions (of both parameters and shapes) to do stuff. Those can be given more descriptive names. The holy grail here is probably some pure functional programming notation for CAD.

@sjb Currently all my variables are globals (does it support module locals?).

Even if it did, I often need to borrow values from unrelated parts of the design structure.

It would be cool if it had some form of namespacing, where you can access any variable at any level of the design, but more local variables can be expressed more concisely.

@jhol It's actually the one time I really appreciate the C++ scoping of class member variables. My object has loads of variables, all methods of it (producing various related parts) have access to the same variables. Plus you can have constructors (e.g. parameterised by standard screw thread type).

Sign in to participate in the conversation
Mastodon

Fast, secure and up-to-date instance, welcoming everyone around the world. Join us! 🌍
Up since 04/04/2017. ✅

Why should you sign up on mstdn.io?

This instance is not focused on any theme or subject, feel free to talk about whatever you want. Although the main language is english, we accept every single language and country.

We're connected to the whole ActivityPub fediverse and we do not block any foreign instance nor user.

We do have rules, but the goal is to have responsible users.

The instance uses a powerful server to ensure speed and stability, and it has good uptime. We follow state-of-the-art security practices.

Also, we have over 300 custom emojis to unleash your meming potential!


Looking for a Kpop themed instance? Try kpop.social