simple manual assembly, with annotations in 3d model view

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

simple manual assembly, with annotations in 3d model view

Post by jmaustpc »

Hi all

This is a simple example to illustrate assembling a model from multiple parts as opposed to using a boolean operation between parts, csg methodology, to make a hollow cube.

But when making something from timber screwed together, or plate welded, then I prefer to make every real world part a separate solid, sometimes a solid would require some csg (I mean here boolean like "cube - a cylinder" to make a "bolt hole" or whatever). The idea I had was that when finished my model by default contains all the exact details required to manufacture the item and its components. I use groups as well as the part history to keep it all organised, my project is in effect a bunch of sub models, so they can be logically extracted for the manufacturing and supplier drawings etc.. In a way my model is like a bill of materials, to some extent.

In short when my project model is finished in FreeCAD, it is pretty much ready for manufacture.

Modeling the cube from individual cubes also allows me to think about and define what I am going to do at the component intersections.

The future functionality of FreeCAD with "definable variables" and the "assembly work bench" will also be useful in this sort of case. As you can see if I change some aspect of a part of the model/project, e.g. the thickness of one of the steel plates used, then I have to manually change the dimensions and/or positions of the other components in the model/project. For the moment I am using my brain as a substitute for the assembly work bench / 3d solver!!! :)

In this "cube from welded plate" example (model attached), assuming that one ordered the "front plate - blank" from the metal merchant and made the cutout in one's own factory, then "front plate - blank" could be extracted from the model for sending to the metal merchant, and the "front plate with cutout" could be extracted for the factory workers on the factory floor so they know where to cut out the hole.

If I had made the cube by "difference boolean" between a larger and smaller cube, then the corners would not be defined, and I would have no component drawings. I actually made this mistake on one of my first designs. I made a closed cube early in the model but was stuck a bit later when I wanted to make one side plate only partly opaque, so that I could see the components I wanted to weld to the inside off the wall of the cube. With the "boolean" construction method I had a cube where I could only easily adjust the opacity of the "whole cube", so that then meant I couldn't see the inside of the opposite wall that I wanted to weld the bits to.

The FreeCAD file attached "cube from welded plate.fcstd.zippednotreally.zip" is not zipped, to open just delete ".zippednotreally.zip" from the file name and open in FreeCAD.
cube from welded plate with 4 different corners.jpeg
cube from welded plate with 4 different corners.jpeg (127.1 KiB) Viewed 4973 times
cube from welded plate.fcstd.zippednotreally.zip
(32.48 KiB) Downloaded 236 times
danfalck

Re: Show your FreeCAD projects here!

Post by danfalck »

How did you do the notes and the leader lines from them?
Thanks for showing this project.

Dan
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Show your FreeCAD projects here!

Post by NormandC »

Thanks Jim! As I said, all projects are welcome, big and small. Even if yours seems simple enough, there a few interesting things, like the notes.

Perhaps you'd be willing to share your python script for it? :) I know of this Python command, but I have a hard time remembering those (haven't tackled Python yet).
wmayer
Founder
Posts: 20310
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Show your FreeCAD projects here!

Post by wmayer »

l=App.ActiveDocument.addObject("App::AnnotationLabel","Annotation")
l.LabelText=["Hello","World!"]
The line is part of the annotation object.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Show your FreeCAD projects here!

Post by jmaustpc »

normandc wrote:Thanks Jim! As I said, all projects are welcome, big and small. Even if yours seems simple enough, there a few interesting things, like the notes.

Perhaps you'd be willing to share your python script for it? :) I know of this Python command, but I have a hard time remembering those (haven't tackled Python yet).

No worries.

Once you have created a "mynote" then just go and adjust everything in the "combi view" like you would for a solid. I think they are pretty cool. With the GUI you can adjust the point at which the line starts "based position" and the point where the text starts below that "text position". Note that the text position is a relative position, relative to the "base position". You can also change fonts, size, colours etc. etc..

The icon is called Tree_Annotation.svg. I assume anyone reading this knows how to create a new custom tool bar and add a macro to it? Let me know if you don't.

This is the text from my macro. As Warner has posted, except that I have import FreeCAD, which I believe is not needed as the FreeCad module would already be loaded.

# Macro Begin: /usr/lib/freecad/mynote2.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++
import FreeCAD
note = FreeCAD.ActiveDocument.addObject("App::AnnotationLabel","MyNote")
note.LabelText=["This is my note"]

# Macro End: /usr/lib/freecad/mynote2.FCMacro +++++++++++++++++++++++++++++++++++++++++++++++++


The last bit of the second line of code "MyNote" is the "label" (text that will display in the tree view) with 001 .... etc. added for multiple notes. The last line of code "This is my note" is the "text" of the note (as distinct from the "label" of the note) which is the text shown on the model. These parameters are also changeable from the GUI after creation so although you can put anything in your macro you can easily change it to something more appropriate later without touching the macro or the python console.

I have another little macro for going to a different web page that Freecad's home page. Great if you want to quickly check on the details of a python command from within Freecad or for some other reason want to surf the net from within Freecad (like going to openclipart.org for example). Anyway I will post that later. Obviously you can do that from Python but this pops up a dialogue box at the press of a button so no having to remember what to type. :)

I will add these to the web site as Yorik said, but not tonight as it is already past 1 in the morning here and I have to get out of bed in just a few hours. :)

good night

Jim
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Show your FreeCAD projects here!

Post by jmaustpc »

The can also add the following two lines to set the default start position in python or your macro.

l.BasePosition = (3.0,0,0)
l.TextPosition = (3.0,0,0)

The "base position" (where the line starts)

At least in the GUI, so I assume in Python as well, the "text position" is a relative position to this "base position".

The numbers 3.0,0,0 can be anything, they are just the x y and z co-ordinates of the point in question.

Jim
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Show your FreeCAD projects here!

Post by NormandC »

Hey, weren't you supposed to be in bed already? :lol:

Thanks for the tip, I'll try that out. :)

Norm, just 5 past noon here
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Show your FreeCAD projects here!

Post by jmaustpc »

Yeah 2:14 am here!

We GMT +10 so pretty close the the date line, US etc. is usually on "yesterday" time from our perspective.

Really off now.... zzzzzzzz :D

Good night

Jim
Post Reply