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

you’d better wait for the mano-wii new jobs, and why not follow his work on the snapping tools and precision modeling so you can understand when it’s the best time to implement new addons and how to …
https://developer.blender.org/T66337
https://developer.blender.org/p/mano-wii/

1 Like

Interesting add-on. As a Rhino CAD designer, I would like to see something like this in Blender.

It is this add-on released or it is just a WIP?

1 Like

Thanks @nokipaike - @RaduCoc this is probably a very stupid thing to do, but I have uploaded a first pre-release of this Add-on to my Website here:

Oh **** that probably was a bad idea, but if anyone want to try it out and let me have their thoughts, please do so. I will be away from home much of next week with Mrs C in our fine capital city, so responses other than email messages might be a little slow as she won’t let me take my Mac with me…

This is very much a first release and still WIP, so please bear that in mind and I haven’t done the install script bit yet, so just add the .py file to your Blender add-ons directory. I have put some basic instructions on my website, but will try to do more as time permits.

Cheers Clock. :cocktail:

2 Likes

@ clockmender

Thank you for sharing this. I will use it this days and I will check how can be improved.

1 Like

I tried.

  1. It need to place this thing somewhere inside N panel or properties - use it from this popup which always auto collapse not the best solution.
  2. It need some “Apply” button which apply current operation settings and automatically select created/modified elements to allow immediately do next step without extra mouse clicks, selection, shortcuts.
  3. It need custom work axis. Now it have XZ YZ XY here need to add View. It need some button to create new from active element normal XY, maybe from 3 vertex, or use one from Blenders custom transform orientations + some dropdown menu where user can select from previously created and saved customs.

Yes, as mentioned above, the addon starts like a separate panel and it is annoying that it is collapsed by default. I need to click the panel to open the options.

Also seems that first need to select the geometry and after that to activate the tool with Shift+P. Not very intuitive.

A good start, but definitely a lot of room for improvement.

Thanks chaps, once I get back home I will find out how to get this in the N panel. This is my first attempt at an add-on so I have much to learn. Currently sat at Lords waiting for the cricket to start, if it doesn’t rain again!!

Cheers, Clock.

Good to know.

To have a good time and weather.

That’s a good point. Sorry didn’t had that in mind. just a little suggestion, can u please make a post to simplify at least these terms:
“skew modifier”, “mask modifier”, “AO”, “f-stop”, “subsurface scattering”, “Principled BSDF”, “sheen”, “specular”
among hundred others? Their simplification will make life much easier for ordinary people, and ultimately, i also fall in them too :sweat_smile:.

If u had made a post already, i’d love to give ur suggestion post a warm heart/thumbs up/like :innocent::blush::heart_eyes:.

Yeah, tooltips are good too. :innocent::+1:

OK I m getting very frustrated! I can add an operator, I can add the location of the cursor in the N Panel, but I cannot add a variable to use in the operator, any hints here would be gratefully received!

Here’s the code I am trying:

class cursorPlacement(Operator):
    bl_idname = 'pdt.cursor_placement'
    bl_label = 'Place Cursor 0'
    bl_options = {"REGISTER", "UNDO"}

    def execute(self, context):
        sc = context.scene
        sc.cursor.location = Vector((0,0,0))
        return {"FINISHED"}

class panel1(Panel):
    bl_idname = "PDT_PT_panel1"
    bl_label = "PDT Cursor"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category= 'View'

    x_loc: bpy.props.FloatProperty(
        name="X", default=0.0, precision=5, step=1,
        description='X Coord')

    def draw(self, context):
        layout = self.layout
        cursor = context.scene.cursor
        row = layout.row()
        row.operator("pdt.cursor_placement", icon="EMPTY_AXIS", text="Place Cursor Origin")
        row = layout.row()
        row.prop(cursor, 'location')
        row = layout.row()
        row.prop(self, 'x_loc')

def register() :
    bpy.utils.register_class(cursorPlacement)
    bpy.utils.register_class(panel1)

def unregister() :
    bpy.utils.unregister_class(cursorPlacement)
    bpy.utils.unregister_class(panel1)

if __name__ == "__main__" :
    register()

The error in the terminal is:

05

Can someone just get me started, or tell me where to look for the answer please?

You struggle to understand a basic question.

Blender has existed for 20 years, and until recently there was zero, and I say zero will to harness tools cad in blender, this means that until now the blender community didn’t care a lot about CAD because it’s a world well different.
My hope is that blender users, who are obviously not engineers otherwise they would use other tools well, is that they start adopting CAD techniques, and a new line of blender users is formed that makes them grow and evolve just as it was for Computer Animation Graphics.
Now imagine you starting to create Tools with abstruse names that people don’t understand, because names come from other Software that they never saw or used in their lives … Do you think it’s a positive approach to do?

So please, instead of arguing and being sarcastic, make yourself useful and share your knowledge if you want, otherwise close the question here.

@anonym & @nokipaike Please stop arguing on this thread of MINE, I am trying to get an answer to a question and this noise, not related to my quest is not helping me! I am trying to respond to a request to move these functions into the N Panel and cannot work out how to place variables and use them in the operators…

Thank you for your understanding. Clock. :wink:

1 Like

@clockmender you know this support channel of blender’s python? this channel is on volontary base but there are present also Blender devs

My guess is the “property not found” error is caused by the mismatch between the class name “panel1” and the “bl_idname” attribute “PDT_PT_panel1”. FYI, in 2.80 you do not even need to have a “bl_idname” attribute as long as the child class is not inheriting from an “Operator” parent class (like “cursorPlacement”).

Thank you for the reply, but if I leave out the bl_idname = “PDT_PT_panel1”, I get this error:

Warning: 'panel1' doesn't contain '_PT_' with prefix & suffix

And the property not found error as well!

Cheers, Clock.

OK, I have sorted this, it was far more complex than I had imagined, but here is a start:

I had to make an “init” file and declare variables in the scene first, like this:

Scene.pdt_loc_x = FloatProperty( ball blah blah, then use these in the panel menu and in the script to place the cursor, the good thing is that I think it more intuitive (you may not agree) and easier to use with less mouse clicks. So far I have only got the Absolute (easy to do), Delta and Distance@Angle working, but it is a start for my now overheated old brain. :fire::brain: so I am going to go outside and cut some grass…

I have also changed it so I can work relative to the current position of the cursor, or relative to a selected object, or vertex. This means you can just nudge the cursor, say 2 units at 33.5 degrees from an object first then repeat the move from the current position of the cursor.

I am once again a happy boy (or is that “old man”…)

Cheers, Clock.

EDIT:

So, after a bit of grass cutting and some more work, I have got all the Cursor Operations working now:

Here I have placed the cursor at the intersection of the four vertices of this face. Now I need to get the Move Vertex, New Vertex and Extrude functions added in. :crazy_face:

3 Likes

Merci Bien for the likes!

I have got this far:

Most of the functions are now in there, just the New Vertex and Extrude Vertices options to go, but it’s getting late here now and I am tired and in need of some Jamaican rum…

@RaduCoc and @IIIFGIII you were both right of course, it needed to be in the N Panel, much better solution, thanks for the push I needed to learn this stuff. :grin:

Cheers, Clock. :cocktail::cocktail:

EDIT:

A question; Is it possible to have a list of objects in the N Panel that I can re-order, if so this will let me use the Intersect option on Objects - anyone know how to do this?

7 Likes

hello.

may i suggest anyone who is working on cad for a blender addon or even blender itselff:.
the intersect tool is totally broken for architecture usage.

this is important ! we need love too :frowning:

Indeed you may, this is one reason why I am working on this stuff. I am mechanical engineer, by training, but the same applies to my field as to yours. CAD tools in Blender are “not good enough” yet, hence my development. I will look at this in more detail, Boolean Modifiers, or Boolean shapes in Edit mode often make a complete pig’s breakfast of the nice Ngon topology we like to work with. I shall be addressing this after I have completed my current quest!

However, here is the “Mother of All Cheats” that might help you in the meantime:

48

Extrude the profile to get the skirting board, then rotate the end 45 degrees as shown above using 3D cursor.

12

Scale in all bar height axis by root 2 (1.414213562373095 is near enough :rofl::joy:) and then extrude this down and then scale end profile 0 in depth axis like so:

One day we will be able to do this properly… All CAD people need some love!

Cheers, Clock.

1 Like

i know this technique, but the intersect should work correctly, as as the inset tool, and blender should support good cad modeling tool natively.

Great addon by the way.:sweat_smile:

1 Like