Part-o-magic [New: Selection tools, container duplication]

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Locked
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic (again) [icon ideas for new tool wanted!]

Post by DeepSOIC »

triplus wrote:Like a new migration tool from current PartDesign model to PartDesign NEXT model?
Well, not. Migration is for old files only. My tool is general purpose. But it is primarily useful for migration-like activities.

Application example:
I'm using that incredible work by ppemawm - Vintage Steam Tractor Miniature
morph container howto.png
morph container howto.png (916.46 KiB) Viewed 2199 times
After converting Groups into Parts, it becomes possible to play with model by e.g. moving subassemblies around, hiding/showing them, entering, etc.
Steam_Tractor move apart.png
Steam_Tractor move apart.png (602.74 KiB) Viewed 2199 times
I have tried converting everything into Parts in that model. There are quite a few bits that remain floating around, because ppemawm didn't follow the new rules to containership, (due to confusing behavior of tree view, and him working on 0.16)... but overall, the result was almost usable!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part-o-magic (again) [icon ideas for new tool wanted!]

Post by triplus »

Therefore during the GSoC you and @ickby as mentors and the students will try to figure out on how to do that automatically? That is whenever a feature in FreeCAD is inserted into an active document from any workbench. If inserted feature doesn't have any parent Part container is automatically added and the feature is made available inside of it?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic (again) [icon ideas for new tool wanted!]

Post by DeepSOIC »

New feature in Observer
* expand-o-matic.
3D view now reacts to expanding/collapsing containers in tree.
expand-o-matic.png
expand-o-matic.png (439.45 KiB) Viewed 2135 times
Before, in order to see smething inside the body which is not the last feature, you had to enter the body. And it was so by design, so that you don't attempt editing it without activating it.

However, this makes it impossible to pick a datum feature for say an assembly constraint. So, even though we don't have such assembly constraints yet, I thought it'd be cool to roll this feature out anyway. It's an experiment :mrgreen: .
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part-o-magic (again) [new feature: expand-o-matic]

Post by triplus »

I did a quick test and i am guessing only one Body at a time for now? If only Assembly 2 plane constraint could work with such plane! ;)
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic (again)

Post by DeepSOIC »

I've patched up part-o-magic a little bit (it was seriously broken by some recent changes to FC). I think it should be in a usable state now.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic [patched up! should work again!]

Post by DeepSOIC »

New tool.
* Straighten Camera

Icon is quite ugly... sorry about that :mrgreen:

It is an attempt to collapse standard-view buttons ...
std-views.png
std-views.png (4.83 KiB) Viewed 1746 times
... into one.

This is what it does. On first click, it un-tilts the view, i.e. rectifies horizon. On second click, it switches to nearest standard view. Third click undoes the previous two.
SnapView-action.png
SnapView-action.png (123.74 KiB) Viewed 1746 times

Let me know if you want that button in master. A better icon will be needed then.

PS. You may experience some strange behaviors close to top/bottom views. I don't know how to properly rectify the horizon in this case. This needs thinking and tweaking.

EDIT. Credit. @jaisejames asked for the feature here: https://forum.freecadweb.org/viewtopic.php?f=8&t=25632. Although I wanted to do this button for a long time, it was his post that made me finally do it.
Last edited by DeepSOIC on Sun Dec 03, 2017 11:07 am, edited 2 times in total.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part-o-magic [new tool: straighten camera]

Post by triplus »

I inserted Part Cube feature and aligned the view to standard top. After using Straighten camera command for 3 times. Last click resets the view. The first two slightly rotate the cube towards Axo View but at a smaller angle.

Is this what should happen? What would be the standard use-case?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Part-o-magic [new tool: straighten camera]

Post by DeepSOIC »

triplus wrote: Sat Dec 02, 2017 6:18 pm Is this what should happen?

- Last [third] click resets the view.
-yes


triplus wrote: Sat Dec 02, 2017 6:18 pm - The first two slightly rotate the cube towards Axo View but at a smaller angle
Sounds like yes, but I don't know. First click should make Z axis vertical on screen, second should snap to nearest standard view (which may have been axonometric for the rotation you initially were in).

The idea is that instead of having to pick the correct view button on toolbar, you just rotate the view to be close to desired precise view, and then click this button twice. Just less thinking required.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part-o-magic [new tool: straighten camera]

Post by triplus »

I am starting to get the idea now after reading the discussion twice and doing some tests. On what it should do. Well i guess why not and for sure it can be useful for some users and in some use cases. That is for some users and in some use cases standard view toolbar works just fine. Sometimes NaviCube makes sense. Straighten camera command then again works too.
DeepSOIC wrote: Sat Dec 02, 2017 6:34 pm First click should make Z axis vertical on screen
I wonder if this is useful enough to justify the level of potential confusion involved? Or should the command just "Straighten camera" or go back to "original view" and that is that?
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: Part-o-magic [new tool: straighten camera]

Post by Pauvres_honteux »

Hi @DeepSOIC,

1:st; I second this initiative, +1 !

2:nd; in catia there's a similar function. It works like this: one starts the function, then click on a flat surface or datum plane. The camera imediately rotates the clicked surface/plane to become parallel to the screen. Very nifty! But they do not have your "to the closest iso"- thingie!

Another function may then be started to save this new camera position and direction with a suitable name, to be easy accessible later.

At work I use the two functions to making my own version of ISO views in a drawing. To have an own, parametric, "iso" view is absolutely cruscial when setting up an assembly drawing, based on an assembly of parts, due the fact that the content will change over time and one must be able to easily replace the ingoing updated parts and with a single click update the assy drawing with the previously set view intact!

I also use it to check how things look like from eye height at a distance (first making a parametric datum plane, can be made in FC but do not survive a save-open procedure due to the datum point bug)
Locked