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

It’s just experimental code, nothing you can play with yet. :grin:


Before.


After.

Command was Delta, Operation was Split Edges. If you select enough edges to form a face, you get a message saying you can’t do that because it will ruin the topology.

All sensible options for this are now coded, but I need to check integration of the functions and check for bugs, etc. I won’t get anything done tomorrow, so it will be Sunday at the earliest before I can upload a version with this option.

Cheers, Clock.

Edit:

When will people learn to spell “tyre” properly when referring to the rubber around a wheel, “tire” means to grow tired, or to lose energy etc.:

56

:rofl::rofl::rofl::rofl::rofl::rofl::rofl::rofl:

1 Like

so … delta operations, with “spit edge” and “current” … will they be able to split the segments many times?
:grin: … (I learn quickly.)

1 Like

You don’t have to have Current selected, it ignores this setting, it does it by default as the split edges remain selected, so when you press Delta again this happens:

19

Press it again and this happens:

58

Ad Infinitum :grin:

You sure do!

2 Likes

Testing is going well. The Split Edges command is now built in to the Commands and also the Command Line, this took some effort this evening, but here is a mesh drawn entirely with the Command Line, including Split Edges by Percent - command was sp30 to split at 30% and Blender Bevel:


Do You Like the Topology?

Testing must continue tomorrow, then I can upload a “Fix” with this in it.

Question: Should I put all the Releases and Fixes on a separate page on my website? I think it might get too crowded if I continue to put them on the main page for PDT. I have spent quite some time refining the code again and found a few little bugs, well, procedural problems really and corrected those.

Cheers, Clock. :cocktail:

4 Likes

I’ve been following the progress of the PDT add-on with great interest. Initially do to the promise of precision modeling tools, but quickly out of the openness of the add-on’s development. I enjoy reading the process, it is insightful.

Eventually I will download the PDT add-on and give it a test, likely soon as it appears to be in a fairly stable state of its overall development now, with help / how-to documentation on the way. I am not an engineer or architect, just a “Visual Communications Specialist” (actual eye-rolling university job title) / 2D medical illustrator who dabbles with 3D and likes a bit of precision when assembling objects. Thus limited in understanding of CAD software tools and jargon.

I also have no coding skills.

Still I feel inclined to offer assistance as I’ve grown attached to the want for this add-on to succeeded. I am sure downloading, learning, testing, and providing attentive feedback will help. Though until then I can at least answer your inquiry into website visitor feedback. To which I say, yes, I do believe that separating the PDT add-on page into multiple pages will improve user accessibility.

Ideally there would be a landing page with the add-on’s overview, screen-shot, current version download, a link to the help, a link to version history, a link to this and any additional forum thread where its development is actively discussed. As the PDT add-on project has become so significant you might consider giving it a separate drop-down on your website’s main navigation menu so the PDT add-on’s sub-links can be directly accessed from anywhere within your website, should you have visitor’s that like to flutter around like a leaf in the wind.

Speaking of which I have to fly off to run errands. I hope this unintentionally rambling message successfully conveyed my appreciation for your time and effort in the ongoing development of the PDT add-on, as well as helped you a little in deciding what to do with your project’s landing page.

1 Like

Did you publish this on blenderartists forum the scripting section ? It will attract more users there…

4 Likes

Thanks for the replies, I am out just now but will reply properly later.

Cheers, Clock

1 Like

Thank you for your thoughts, I have tried to implement most of them tonight, but I think I have run out of time to get everything right. I have uploaded a new version, but I think I then found a little error in it… I will look again tomorrow when I am not so tired. I think I will stop adding any new features now and do another testing programme, then I will make a new release after that when I am more confident there are no errors.

Thanks for the advice re my website, I have done most of the things you suggested, other than put the latest release on the opening PDT Page, again, no more time today.

Not yet, maybe I should do a little more testing before I do that, I am not confident I have got all the bugs out yet, but I will do so later on. Thank you for your idea!

Thanks to everyone who is helping me with this project.

Cheers, Clock. :cocktail:

EDIT:

It’s the Command Line that is not quite right yet, let me work on this some more…

5 Likes

the small group that we are here, we can act as a beta tester, then publish and don’t worry

2 Likes

I noticed the adjustments you made to your website. I used the updated navigation to quickly visit the PDT add-on’s download page where I aptly downloaded the PDT add-on. I won’t likely do a deep dive into the PDT add-on’s functionality tonight, but I plan to explore it further in the weekdays ahead.

I did have an initial observation, and thus suggestion/request. Would you consider giving PDT add-on its own tab in the N Panel. There are a lot of utilities in the PDT add-on, and it might improve accessibility and focus to give them a dedicated space. The tab could simply be labeled PDT which is descriptive and short. A win-win for anyone with an overcrowded N-Panel.

Another potential option, which I’ve only seen one add-on implement ( 3D View: 3D Navigation ) is a text input in the add-on’s preferences that provided the user with the ability to type in the N Panel tab category they want the add-on to be placed. This would give a user the maximum flexibility to customize Blender based on their workflow but would also increase the add-on’s complexity and add potential maintenance work. So it is more of a feature to consider than an actual request.

Particularly as you are planning a feature freeze to encourage user testing. Testing I hope to participate in once I read through the PDT add-on documentation / help pages on your website.

Cheers. :smiley:

1 Like

Good Idea, I just didn’t know how to do this before, but now…

More later, I must do some other things first today.

Cheers, Clock.

EDIT:

Sorry, the help is not completed yet…

5 Likes

@clockmender recently the addon devs are updating the addons in order to allow the tab customization and aggregation simply by renaming it
maybe you can take a look at the code to see how it’s done

Screenshot%20(151)

2 Likes

There is no documentation for this yet, but I have renamed it to conform in the new version (Location: View3D > UI > PDT) I am preparing now, I have altered some other things and am now testing these before I upload it.

Thanks for this!

EDIT:

41

2 Likes

Oh dear, this is embarrassing :crazy_face:, I omitted one of the options from the Tools section of the menu. So I have corrected that and made some other changes (latest release on PDT Download page), new Tools section:

22

Now the Taper Command can be driven properly, I only found this when I was doing the Help page for this bit…

Here the Taper command has been used to taper the right end of the cube to 10 degrees, rotation is Y axis, movement is X axis:

Sorry! Clock. :rofl::cocktail:

EDIT:

I have taken the decision to freeze new features until thorough testing has been completed. Please let me know if you find any problems.

1 Like

Just tested out the latest version and I seem to be getting random crashes with this showing up in the console:
Error : EXCEPTION_ACCESS_VIOLATION

Not sure what is causing it yet. IIRC, this can be caused by trying to read from or write to a memory location that no longer valid (e.g.: a variable that has gone out of scope).

I also had a bunch of errors dumped to the console when I disabled your addon:

Exception in module unregister(): 'blender-2.80-win64\\2.80\\scripts\\addons\\clockworxpdt\\__init__.py'
Traceback (most recent call last):
  File "blender-2.80-win64\2.80\scripts\modules\addon_utils.py", line 437, in disable
    mod.unregister()
  File "blender-2.80-win64\2.80\scripts\addons\clockworxpdt\__init__.py", line 299, in unregister
    unregister_class(cls)
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered)

Error: Traceback (most recent call last):
  File "blender-2.80-win64\2.80\scripts\modules\addon_utils.py", line 437, in disable
    mod.unregister()
  File "blender-2.80-win64\2.80\scripts\addons\clockworxpdt\__init__.py", line 299, in unregister
    unregister_class(cls)
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered)

A few other things.

When Show Pivot is enabled, maybe have it then toggle to Hide Pivot? MeasureIt does this with its Show / Hide functionality. From measureit_main.py:

        row = box.row()
        if context.window_manager.measureit_run_opengl is False:
            icon = 'PLAY'
            txt = 'Show'
        else:
            icon = "PAUSE"
            txt = 'Hide'

        row.operator("measureit.runopengl", text=txt, icon=icon)

And for the bl_info in the __init__ file I think you have this in the latest release:
"version": (1, 1),
I can’t remember if this breaks any Blender functionality, but the Blender addon guidelines recommend using semantic versioning (MAJOR, MINOR, PATCH).

2 Likes

Done! I also found all the other code that executes this, so now:

I had looked at this before, but just didn’t understand all the background execution code then.

Done!

bl_info = {
    "name": "Precision Drawing Tools (PDT)",
    "author": "Alan Odom (Clockmender)",
    "version": (1, 1, 1),
    "blender": (2, 80, 0),
    "location": "View3D > UI > PDT",
    "description": "Precision Drawing Tools for Acccurate Modelling",
    "warning": "BETA",
    "wiki_url": "https://clockmender.uk/blender/precision-drawing-tools/",
    "category": "3D View",
}

I am not getting this on my Mac with Official 2.80, or Alpha 2.81 Blender, do have any ideas as to where I should look please? I do not delete any variables other than with code, only read them and set them within their ranges.

This is the difficult one for me. Is this down to the order in which I unregister things. From what I can gather, I should register in order; Operator Classes, Menu Classes, Variables. Then unregister Classes - reverse the list, then Variables - this is how I see it done elsewhere, but I think something is not getting unregistered, but I don’t know what, do you know anything that might point me in the right direction here please?

Thanks for the feedback, I am learning so much, but this has been valuable for me.

Cheers, Clock.

2 Likes

No Clock - it’s you being a Complete Bozo and calling 2 classes in two files by the same bl_idname - pillock! :crazy_face: In the end I registered the classes one at a time rather than in a list to find the culprit, I also noticed an error in the deleting variables routines.

OK, I have put that right also and now the Add-on disables properly, I shall upload later once I have finished exhaustive testing of these mods.

Cheers, Clock. :cocktail:

EDIT:

Update uploaded to my website. Does anyone know what determines the order in which menu sections appear in the n Panel, it not Alphabetic, it’s not the order in the register functions, GOK what it might be…

2 Likes

OK, as we say in England; “Money where my mouth is”, here is a model built with PDT and Offset Edges Add-ons:

Not that remarkable really, except is it totally accurate to dimensions, not guessed by tracing over a reference image, not approximated by zooming right in to place intersections, none of that. You could 3D print this and it would be “to dimensions”. Draught angle on this casting is 5 degrees by the way, not nearly 5 degrees, but exactly 5 degrees, I don’t know how to produce this in Blender using only Blender tools, without “fudging” it.

I will dimension it later, when I get some spare time, but I hope it demonstrates the abilities of PDT - given that it was quick and easy to produce this using only a set of dimensions on a paper drawing. This is only half of the casting, but as the other is a mirror image I thought I would leave that off and leave it in Edit mode so you can see the topology - perfect for mechanical, or architectural, models.

Cheers, Clock.

14 Likes

I started toying with it and it started to get really interesting and useful … especially now that I read the short tutorial on your site …
the first panel is now clear to me …
of the tools panel some functions still I am not clear their usefulness (probably my engineering gaps)
I haven’t scoured the other panels yet.

6 Likes

I have created an initial GitHub project here:

There is much work to do on this GitHub Project, so please be patient until I get everything sorted. Once I am happy I have done it properly, I will link this on my PDT Downloads page on my website. I also intend to upload this to developer.blender.org for consideration for it to be included with Blender releases, once (if) it has passed all the required tests!

Cheers, Clock.

EDIT:

Now submitted on Blender Developer: https://developer.blender.org/T70238

If anyone want to help me test this, please do so and let me know of any issues on the GitHub page for this - thanks!

10 Likes