Part design feedback and questions

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
jjsca
Posts: 24
Joined: Thu Mar 01, 2012 8:58 pm

Part design feedback and questions

Postby jjsca » Thu Mar 01, 2012 10:13 pm

Hello,

I've been trying out freecad for a while now and I would like to share my opinion about it. First of all, it realy has got a great potential not only because it is free but also because it is very well thought and it allows the user to adapt it to a specific use which is great ! And now with the part design workbench, it really became a great piece of coding. I've had the chance as a student to use 2 of the most used CAD softwares, inventor and catia 3d, they are very powerful but they are also a great source of inspiration.
I think that freecad could become even more interesting with some "basic" tools added. During my CAD experience, I almost always used the same set of tools:

- extrusion (already included in freecad)
- negative extrusion (pocket tool, same as above)
- revolution aroud an axis (read that the axis what going to be implemented )
- negative revolution (a tool that makes a sketch revolve around an axis, typically to make a conic hole)
- extrude along path (like the sweep macro)
- negative sweep
- hole tool (makes normalized holes for mechanical engineering)
- shell tool (digs the part so that only a given thickness remains)
- outer threads for revolution parts (to make special screws)
- circular and rectangular repetition of an object (action, like holes or pockets or even rectangular repetition themselves...)

With these tools, I think it is possible to model quite a lot of parts and even if the precise tools doesn't exist you can always find an alternative. I tried to make macros for those tools with the (very) small python knowledge i have, but I only managed to modify the sweep macro to tranform it into a negative sweep tool. And I noticed that unfortunately this macros doesn't produce parametric tools (is there a way to keep the sketches as parameters for the sweep ? and I also wondered is there a way to display tools options in the task panel instead of a dialog?). Is there a page where the entire Part (for exeample Part.Solid, Part.Wire... methodes) api is described easily (to know precisely the structure (linking properly objects with shapes and) to use to make a good macro)?

As I sad I am far from beeing a great programmer, but maybe if everyone motivated helps writing small macros or bits of code it might help to develop freecad.

I would like to propose something for the construction geometry (if it is possible to code it of course), I 've seen that construction geometry is usually displayed in dashed (_ _ _) lines and revolution axis in dash-dotted (_ . _ . _) style. This has the advantage to make sketches very clear and makes it possible to use colors to show constraint level of the geometry.

I saw that in the drawing templates repository there were no A4 templates, I'll see if I've got the time this weekend to submit one or two of these if I get to understand how to post them on the site :lol: I post this message hoping that it will give a constructive feedback and I hope it will be helpful.

I really thank the developper team which has really done a great work !!! And i m looking forward to seeing the assembly module !!!

J.J.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Part design feedback and questions

Postby NormandC » Fri Mar 02, 2012 12:51 am

Hello J.J.,

Nice feedback here. :) I'm not a developer, but I came here 2 years ago and never left. :D

I'd be curious to know what FreeCAD version you're using and operating system. As for myself I'm on Ubuntu, and so there are very few choices as 3D CAD software go in Linux. There are 3 open source projects that I know of: HeeksCAD's development seems stopped, its creator wanting to scale it back; NaroCAD, locked in to .NET technology so Windows-only; FreeCAD is the only game in town. And it's coming along quite well.

Many missing tools you've mentioned are already planned. These guys do have a clear vision of where they want to go. I suggest you have a look at the development roadmap: https://sourceforge.net/apps/mediawiki/ ... nt_roadmap
jjsca wrote:- negative revolution
It' missing for now, but what you can do in the meantime is produce a separate solid and do a boolean cut from the Part workbench.
jjsca wrote:I only managed to modify the sweep macro to tranform it into a negative sweep tool.
I'd say it's a whole lot better than what I was able to do! I'm really Python-challenged... Would you care to share your modified macro?
jjsca wrote:And I noticed that unfortunately this macros doesn't produce parametric tools (is there a way to keep the sketches as parameters for the sweep ? and I also wondered is there a way to display tools options in the task panel instead of a dialog?).
It is possible to create a parametrized script. There are a few sample scripts installed with FreeCAD. In Linux they're in /usr/lib/freecad/Mod/PartDesign/Scripts. The Spring.py script creates a parametric spring. You can modify its parameters in the Property box. There's a way to execute the script from the python console but I never remember how. I just copy them to my macros folder for convenience. :roll:

I don't understand your third question. What tool options are you talking about? PartDesign tools already use the task panel.
jjsca wrote:Is there a page where the entire Part (for exeample Part.Solid, Part.Wire... methodes) api is described easily (to know precisely the structure (linking properly objects with shapes and) to use to make a good macro)?
Yes and no. The wiki lists the existing APIs, but it's not easy for a guy like me to understand. Have you looked at these links?
https://sourceforge.net/apps/mediawiki/ ... _scripting
https://sourceforge.net/apps/mediawiki/ ... ed_objects
https://sourceforge.net/apps/mediawiki/ ... tegory:API

These links and a few more are available in the Main Page's sidebar.
jjsca wrote:I saw that in the drawing templates repository there were no A4 templates, I'll see if I've got the time this weekend to submit one or two of these if I get to understand how to post them on the site
Yeah there are none so far, there's one installed with FreeCAD though (modified from the A3 one). More are of course welcome! To post them on the site is easy, but you need wiki edit rights, which you'll get in no time if you ask. :)

Hope you hang around!

Norm
jjsca
Posts: 24
Joined: Thu Mar 01, 2012 8:58 pm

Re: Part design feedback and questions

Postby jjsca » Fri Mar 02, 2012 9:29 pm

Hi normandc, thank you for your answer and all the usful links (especially the roadmap, now I know where to get fresh information on freecad content :D ).

I am running Freecad 0.12 (5284) on windows 7 64 bits. It has a few display bugs with spheres and smoothed objects but otherwise it is quite stable.
I'd say it's a whole lot better than what I was able to do! I'm really Python-challenged... Would you care to share your modified macro?
No problem here's the thing, but well I am not satisfied of the code (wich is not very different from the sweep macro), I'l keep on studying the scripting pages, I ll se if I manage get something parametric (by the way I looked for the Spring.py file, but I dont find it on freecad directory do you have the source of it , it might help...). I did try to get information from the API pages but as you said these are not really easy to deal with for non-programmers or beginners like me.

Code: Select all

import Part, FreeCAD, math, PartGui, FreeCADGui
from FreeCAD import Base
s = FreeCADGui.Selection.getSelection()
i = 0

try:
     shape1=s[0].Shape
     shape2=s[1].Shape
     shape3=s[2].Shape

except:
     print('Wrong selection')
     i = 1


try:
     traj=Part.Wire(shape1)
     section=Part.Wire(shape2)
     objectToDig=Part.Solid(shape3)

except:
     print('Wrong selection')
     i = 1

if i ==0:
     myObject=App.ActiveDocument.addObject("Part::Feature","Channel")
     makeSolid=1
     isFrenet=1
     Sweep=Part.Wire(traj).makePipeShell([section], makeSolid,isFrenet)
     channel=objectToDig.cut(Sweep)
     myObject.Shape=channel
To dig a sweep in an object, you have got to select the path first, then the section of the sweep and finally the solid you want to dig in. I tested it on a few test parts and it seems to be working (but I dont guarantee it)
I don't understand your third question. What tool options are you talking about? PartDesign tools already use the task panel.
Well the point is that default freecad tools use the task panel and I wonder if there is a way to use it for macros too, but I did not find any issue about that. It would unify the way to use and program tools and macros in freecad, typically for the macro above, I would allow the user to select one object at the time and so there are less chances that the path gets extruded around the section and so on..

I also worked on the a4 template (had a bit of free time :D ) and it seems to work on my freecad version, I just added editable texts and those are not supported by my 0.12 version. I think this template could be useful for freecad and it is heavily inspired of the drawing I produced with other professional CAD softwares. If it works, I'm going to add it to the examples on this website (where do I have to ask for wiki edit rights ?).

I added a .zip file with the template, an image of what I managed to get on my screen and the python code for a macro. You actually just need to drop the template in the template directory, then create a macro and save it. After you just have got to edit the macro file in a text editor and save it (don't forget to change the template directory if you are running on linux or other os ;) )

If anyone could give me a small feedback if the template is displayed correctely and if editable text works, it would be nice.

Have a nice evening everyone ! Hope this message is helpful... (sorry for the English mistakes, but it ain't my mothertongue...)

J.J.
Attachments
drawing_template_a4.zip
(127.62 KiB) Downloaded 68 times
wmayer
Site Admin
Posts: 15501
Joined: Thu Feb 19, 2009 10:32 am

Re: Part design feedback and questions

Postby wmayer » Sat Mar 03, 2012 1:55 pm

You'll find the code for the spring here: http://free-cad.git.sourceforge.net/git ... d441bb3d92
Well the point is that default freecad tools use the task panel and I wonder if there is a way to use it for macros too,
That might also be possible. You will find a simple task panel example here: http://free-cad.git.sourceforge.net/git ... d441bb3d92
(where do I have to ask for wiki edit rights ?)
Also here :)
wmayer
Site Admin
Posts: 15501
Joined: Thu Feb 19, 2009 10:32 am

Re: Part design feedback and questions

Postby wmayer » Sat Mar 03, 2012 2:26 pm

If anyone could give me a small feedback if the template is displayed correctely and if editable text works, it would be nice.
The drawing displays correctly but the editing doesn't work as is. When replacing "freecad:EditableText" with "freecad:editable" then it works fine for me.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Part design feedback and questions

Postby NormandC » Sat Mar 03, 2012 4:15 pm

Hi,

Thanks for the script, I'll check it out. :)
jjsca wrote:It has a few display bugs with spheres and smoothed objects
Do you mean they look blocky? If so you can change the display accuracy in the Edit --> Preferences menu, Part Design, "Shape View" tab. Change the value for the "Maximum deviation..." setting. I think default is 0,1000%, you can try 0,0500% and see if it improves.
jjsca wrote: I just added editable texts and those are not supported by my 0.12 version.
FYI, jriegel published a v0.13 unstable installer, if you want to check it out for yourself. I'm not sure but I think on Windows two different versions of FreeCAD can cohabit.

Since the stable is proposed by default, you need to go to the Files page to get the unstable version. And by the way there is a new cool Drawing view wizard to easily create multiple ortho views in one go. :)

I like your A4 portrait template, I think I'll do an A version of it (US letter).
jjsca
Posts: 24
Joined: Thu Mar 01, 2012 8:58 pm

Re: Part design feedback and questions

Postby jjsca » Mon Mar 12, 2012 7:23 pm

Thanks for your answers guys ! I got the latest build installed as it seemed to be quite stable. I made some more templates in the same style (A4 and A3 landscape) and tested them they seem to work fine. Thanks to wmayer for the editable rectification and all the useful code links ;) !

I am going to ask for editing rights in the wiki on the dedicated topic and add those templates to the examples. And see if I have got the time to write a small Part design introduction tutorial to give the basic methods like having sketches constrainted correctly and so on...
normandc wrote:I like your A4 portrait template, I think I'll do an A version of it (US letter).
Well if you want I splitted the different elements into different files to make files easily and very fast, If you confirm me the dimensions (8.5 by 11 inches or 215.9 by 279.4 mm), I'll make one in US letter format too, it takes me about 3 minutes so if it saves time to you... Just in case do you also use normalised borders (like for example 10mm margins for 3 borders and 20mm for the last margin)?
normandc wrote: Do you mean they look blocky? If so you can change the display accuracy in the Edit --> Preferences menu, Part Design, "Shape View" tab. Change the value for the "Maximum deviation..." setting. I think default is 0,1000%, you can try 0,0500% and see if it improves.
Not quite actually, it does not seem to be the display precision that is too low, it is rather some sort of profile or polygonal faces rendering on the rounded surfaces like spheres, I woul describe it as artefacts. It is hard to explain it without an image (I still didn't find out if we can post images and how, when I attach .jpg or png files it returns me errors :oops: ) I joined examples as attached files, maybe I should write a bug report ?

I am also continuing my eternal quest for automatic updating sweeps and negative sweeps, the macro code has changed a lot but it got quite strange now and the method to get the objects is let's say not very conventional, so I am note going to post it here, I am certainly going to create a topic in the help section to get clear programming answers, the open discussion is not thought for that...

Nice evening to everyone...

J.J.
Attachments
Artefacts_on_shapes.zip
(253.51 KiB) Downloaded 46 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Part design feedback and questions

Postby NormandC » Tue Mar 13, 2012 12:44 am

jjsca wrote:If you confirm me the dimensions (8.5 by 11 inches or 215.9 by 279.4 mm), I'll make one in US letter format too, it takes me about 3 minutes so if it saves time to you... Just in case do you also use normalised borders (like for example 10mm margins for 3 borders and 20mm for the last margin)?
That would be great. :) Yes, exactly those dimensions. I honestly don't remember any normalized borders, possibly ANSI have specs on that, but I don't know them (they don't publish their standards freely). Why 20mm for the last, is that a long side, and would that be to punch holes to put in a binder?

Just found this small info about the ANSI titleblock, but not much else. I say, disregard the ANSI std and simply use the same titleblock you made, scale the borders to fit the page. I've never worked in a company that cared about such standards. :D
jjsca wrote:I still didn't find out if we can post images and how, when I attach .jpg or png files it returns me errors
The forum used to accept jpegs and it was the only image format accepted, but a bug's been preventing that from working for a few months now. The FreeCAD guys have no control over this unfortunately, it's up to SourceForge to fix this, and it seems they don't have a good track record at fixing these things! (Just look at the footer, it says ©2007 which means the forum engine hasn't been updated in 5 years!) You can use a free image hosting service, I recently discovered imagur, it's pretty simple and you don't have to register.

There are currently 2 formats working, zip (as you've found out) and FreeCAD's .fcstd. There is a 256KB limit.

I just looked at your pictures, I have the same here. If you lower the tesselation's maximum deviation to 0,01% the surface will be extra smooth, but at the cost of a huge performance hit (one file with a torus and a sphere, clicking apply froze the window for about 20-30 seconds, and rotating the 3D model is very laggy).

From what I understand of FreeCAD, what you see in the 3D model view is not your actual geometrically perfect object, but a representation of it. I believe the engine that renders the window represents a model's surface as polygons. The lower the deviation, the higher the number of polygons. And BTW, it is the same with all CAD software, some like SolidWorks do an impressive job of smoothing surfaces, but you need some heavy hardware (like a mid-range Nvidia Quadro workstation graphics card).
jcgrillo
Posts: 1
Joined: Mon Apr 09, 2012 5:37 pm

Re: Part design feedback and questions

Postby jcgrillo » Mon Apr 09, 2012 5:57 pm

jjsca wrote: I think that freecad could become even more interesting with some "basic" tools added. During my CAD experience, I almost always used the same set of tools:

- extrusion (already included in freecad)
- negative extrusion (pocket tool, same as above)
- revolution aroud an axis (read that the axis what going to be implemented )
- negative revolution (a tool that makes a sketch revolve around an axis, typically to make a conic hole)
- extrude along path (like the sweep macro)
- negative sweep
- hole tool (makes normalized holes for mechanical engineering)
- shell tool (digs the part so that only a given thickness remains)
- outer threads for revolution parts (to make special screws)
- circular and rectangular repetition of an object (action, like holes or pockets or even rectangular repetition themselves...)
Wow, freecad is impressive! I would like to add to jjsca's list a little bit. A box of tools that would make the design of mechanical assemblies and parts quick, intuitive, accurate, and easy would probably also contain the following:

- thread tool: library of standard thread pitches, including the diameters of bolts inner and outer, possibly coupled to hole tool. Option to NOT render threads, but indicate them in some sort of a 2D fashion (less graphics-intensive). Tool to cut the part to the appropriate dimensions, generate the threads.

- [partial continuation of the previous, yet distinct] screw tool: library of standard screws/bolts/nuts, their MATERIAL PROPERTIES!, their dimensions, the dimensions of their corresponding threads, holes, etc. Same caveat about option to not render as above. Tool to make these screws/bolts, cut their corresponding holes and threads. Option to countersink in the standard manner.

- keyway tool: library of keys and keyway dimensions, tool to cut keyways into parts.

- gear tool

- sprocket tool

- pulley tool

... etc etc etc I too lack python skills, but will learn. This project is awesome. [/rant]
jjsca
Posts: 24
Joined: Thu Mar 01, 2012 8:58 pm

Re: Part design feedback and questions

Postby jjsca » Wed Apr 11, 2012 10:08 am

Hi jcgrillo

Your propositions seems really cool and you are right one of the biggest lacks in freecad's part design workbench for the moment is that there is no support neither for normalized holes and threads... But it is in the roadmap and I'm sure freecad poeple thought about that as Normandc told me these guys know what they are doing ^^

What you sad about pitches is interesting even though I'm don't really understand what you mean about bolts (you mean having a premodelled library with normalized dimensions or something similar ?), because it might be more relevent in assembly design workbench.
jcgrillo wrote: thread tool: library of standard thread pitches, including the diameters of bolts inner and outer, possibly coupled to hole tool. Option to NOT render threads, but indicate them in some sort of a 2D fashion (less graphics-intensive). Tool to cut the part to the appropriate dimensions, generate the threads.
About the threads, I think the best compormise beetween ergonomy and graphic performance is the way Inventor deals with threads (http://grabcad.com/library/asme-b18-screw, like a simple texture). It is not very beatiful but it is really helpful for understanding. It is also very important to have all the normalized pitches (metric, trapezoid, round and of course the ones in inches for people who work with such units). I already gave a thought to that and it might be interesting to store all these informations outer diameter, pitch and so on of the different treads in a file this would allow people to add new threads if they need to.

I already tried to make a simple hole tool, as an exercice, but I really struggled with the manipulation of sketches and the axis of revolution and then, there is another problem I encountered, I couldn't get the selected face with the getSelection() method. All that made that I actually gave up, because just cutting cylinders isn't realistic, it gives flat ends to the holes with should normally be 120 deg...

About the sprocket and gear tool, I think it would be easier to get those form libraries (like traceparts), they are build from normalised dimensions and already modelled, so you save time. But you actually set an issue about a new tool that might be interesting. The teeth profile tool, this would aloud to make special gears wich can sometimes be necessary. With such a tool one could easily make 1 tooth and then repeat it around the base cylinder with a radial copy tool, wich also seems in developpement.

About python devellopping, it is not very easy but with the right examples, it is not impossible and the community is really cool and will give you a hint whenever you are stuck. There is very good example of a macro code (could be used as a tool) in the french forum in the topic "Macro balayage parametrique".

See you around people...

J.J.