Making an Add-on for Precision Drawing Tools (CAD)

OK, question time;

Take this scenario, we have two edge loops selected, they need not be contiguous, or closed, but they are two distinct loops:

One set is closed, one is open, I need to be able to split these selections, image only one set is selected, into two groups of vertices, one represents one loop, one the other. So, does anyone know how to do this, what could I look for as a logic flow?

The idea is that I use the two selected loops to define the two arcs, with their centres and radii calculated by existing PDT Tangents code, then draw the tangents as we do now, only difference is that I don’t have to do the arc analysis as a separate stage - over to the experts…

I know I can’t use vertex indices as they may follow on from each other exactly without an index break, so curve one could be indices 0-15 and curve two could be 16-31. I can’t isolate vertices the make only one edge, because that would be precluded by two closed loops.

Update: I now have the system working for equal sized arcs, where there is no intersection point (well there is one at infinity), this required a little more code:

Thanks, Clock.

2 Likes

Well, I worked it out for myself, so normal service resumes, before:

After:

Or you can expand the menu to show the other input options. I may one day tell you how I did it. :sweat_smile:

Cheers, Clock. :bear: :skull_and_crossbones: :brain: :tea: :tumbler_glass:

3 Likes

Update:

I have changed the menu so you can now select which type(s) of tangents you want to make:

Screenshot 2020-02-17 at 14.29.10

This makes the operation easier to understand and does not make too many unnecessary edges. It will still make both inner, or both outer tangents however, you can just delete the one you don’t want. Getting Blender to know which of these two might be required is beyond reasonable coding as Blender does not store arcs as arcs, merely strings of edges with no way of knowing where an arc ends and a connected straight line begins.

Cheers, Clock.

5 Likes

Am I doing something wrong, or why do I get this?

image

I’m trying to move an empty that has a cluster of objects attached to it.

I want to move from point A to point B, like so:

GIF 09.03.2020 12-25-37

Additionally, I’m wondering if I can freely precision orient a cluster of objects using this add-on:

GIF 09.03.2020 12-17-07

PDT currently only supports operations, like Move Objects/ Vertices for Mesh type objects, so Empties are not supported just now. We can look at moving Empties as well, but this will require new code. I am away from my Mac this week on holiday so I will look at this as an enhancement when I get home.

Thank you for you comment, I will investigate this later. I have also been asked to look at moving curves, both Bezier & Nurb and vertices in curve objects, so will investigate both options together.

Cheers, Clock.

4 Likes

OK, so while Mrs. C. is out walking (I am lounging around on the ship with a drink, or two) I thought about this and I think one change will rectify this for empties:

Line 159 in pdt_command.py is currently this (it checks object type):

        if obj.mode not in {"OBJECT", "EDIT"} or obj.type != "MESH":

if it is changed to this:

        if obj.mode not in {"OBJECT", "EDIT"} or obj.type not in {"MESH", "EMPTY"}:

The system will then allow you to move Empties - what I am not sure of is whether this might make other things fail, since I cannot test it. This will also let you parent many objects to an empty, then move it and the child objects will follow.

I will test this when I get home.

Cheers, Clock. :grin:

EDIT:

You could try this yourself, it is only one minor change, but backup PDT first! (I hope you appreciate the effort it takes to type this sort of stuff on a phone…)

4 Likes

@eobet Fixed in this commit - you should alter the file in PDT add-on to reflect the change.

Cheers, Clock.

4 Likes

Just a quick heads up that @clockmender has asked me to release v1.3.0, which is now up on github.

This release includes the new tangent functionality and the “allow empties” tweak outlined above, both courtesy of @clockmender’s excellent work.

3 Likes

Thank you @ermo, I will always be in awe of how you weave your magic to produce these releases from the messes I leave on GitHub! :grin:

On another note, I was looking at some of the geometric procedures I developed in Animation Nodes some while ago. This included Graph Plotters and Trigonometrical Generators. Details are found on my website here and here.

So, the question is; Does anyone feel that these functions might be a good addition to PDT, I am thinking particularly of the Trig Generators that produce Sine, Cosine & Tangent graphs?

Here is an example of a mesh produced from said functions:

Some of the functions rely on time, so are only applicable in producing animations, like the “Bounce” function, anyway let me know if I should look at porting any of this stuff to PDT.

Cheers, Clock. :cocktail:

4 Likes

What is that CAD software?
Looks unfamiliar)

It’s just Rhino with my custom icons (I’m used to Alias so I had to create a really simple custom toolbar in order to re-train myself). :smile:

2 Likes

Interesting solution =)

About your 1pt and 3pt basepoint snapping proposal - they were realized in NP_Station by Okavango some time ago, do you mean that NP_Station should be built in PDT, or PDT should borrow some NP functionality?

Here is a short demo with 1pt, 2pt and 3pt basepoint alignment from NP

Also hopes that snaps development will progress as well.

2 Likes

I would be happy to do either if that is what is wanted, with your permission of course!

Cheers, Clock.

Im not a hoster of NP, Okavango is.
I just ordered several improvements to my local developer and released the result there.

1 Like

Good News, @Okavango is happy for us to “borrow” his alignment code, so that will go in later, meantime:

The Trigonometrical Waves Generator is now built and under testing:

It works in the Working Plane as all other PDT functions, just needs some more testing and a few DocStrings to keep @ermo happy… :rofl:

I will upload this once I have tested the fudge out of it and am happy it will not break.

Cheers, Clock.

5 Likes

Just spotted a youtube video of this nice addon.

6 Likes

Yes, we have just started making them, by “we” I mean @MarkerTales… We intend to make this more widely known once he is happy that he is well under way with the planned series.

Cheers, Clock. :wink:

2 Likes

Well, we are actually fighting for obtaining such possibilities by default, and afraid that devs will say something like “hey, you already have an addon for this”.
So this is certainly good news, but you need to be more careful with it)

1 Like

Noted! We certainly don’t want to tread on any toes here, maybe you can PM me with your plans in this regard. If you don’t want us to incorporate the Align tools from NP_Station, just say and we will respect your efforts to get them in Blender.

2 Likes

Fun with Trigonometric Waves:

This one was a Sine wave as you can see from the PDT Menu… :mag:

Cheers, Clock. :rofl: :shushing_face: :face_with_hand_over_mouth:

3 Likes