Tree rearrangement?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
FreeRadical
Posts: 49
Joined: Sun Nov 09, 2014 9:48 pm

Tree rearrangement?

Post by FreeRadical »

OS: Windows 7
Word size: 64-bit
Version: 0.14.3700 (Git)
Branch: releases/FreeCAD-0-14
Hash: 32f5aae0a64333ec8d5d160dbc46e690510c8fe1
Python version: 2.7.6
Qt version: 4.8.5
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.6.0

I made a design using a number of CSG operations. Then, I went back and modified one of the low-level elements by adding a sketch to a face and making a pocket. The effect of the pocket does not show up in the end result object. In the tree/combo view, the pocket is listed as a separate object/tree. How do I get the pocket to show up in the original tree at the location of the original low-level element?

I created a simple example. Two rectangular solids (InnerFrame and OuterFrame) which are subtracted to form a thin walled box without a top. Then, I used a cylinder to cut holes in two sides of the box. Then, I went back and added a pocket to the InnerFrame (to make features on the inside of the box). Here's the dependency graph.
FCDepGraph.gif
FCDepGraph.gif (10.79 KiB) Viewed 2358 times
I need to achieve the effect of rearranging the tree so that the pocket is at the location now occupied by InnerFrame. In this simple example, I could pull it apart and and reconstruct appropriately; for the real design, that would be a large, error prone task.

This should be simple to do, but I don't see how to do it.
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Tree rearrangement?

Post by quick61 »

Hi FreeRadical, Welcome to FreeCAD and the Forum.

You forked the model. You should only add features to the most recent item in the history. As you performed your CSG operations, everything before it is hidden (grayed out) because it is the old shape, not the current shape. While you may of been OK if you would of used a CSG operation to make a cut in an earlier part of the history, Mapping a Sketch and Padding it is not the same. Sketches and their associated operations are features of a part, not a part in their selves, like using a cube to make the cut. If you want to use a Sketch and Pocket, only use it on the current state of the model, in this case, Cut001, not on anything before it. So delete the Pocket and Sketch and attach the Sketch to Cut001.

Mark

Edit - Your dependency graph should look like this -
DepGraph1.png
DepGraph1.png (26.75 KiB) Viewed 2346 times
This post made with 0.0% Micro$oft products - GOT LINUX?
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Tree rearrangement?

Post by ickby »

You can also edit the parts used in the boolean operation. For this select the operation in question in the tree view and go to property editor data tab. There you find the entry Base and Tool. If you select it you find a possibility to edit the used parts. Just make sure to hit the recompute button after chaning the parts, than your result will change.
FreeRadical
Posts: 49
Joined: Sun Nov 09, 2014 9:48 pm

Re: Tree rearrangement?

Post by FreeRadical »

Thanks, Mark!

I got it to work on the simple model by following your advice (delete the pocket and sketch, attach a new sketch to a face of the most recent tree node, and then did a pad instead of a pocket as this face is the complementary face).

The dependency graph is now like yours. The tree/combo view shows the Pad as the "active" object. The pad is at the same level as the old cut. Shouldn't the pad show as the only top level item with cut in a sub-level of the pad? Probably: Pad->Sketch->Cut... which would match the dependency graph.

I also tried an experiment where I deleted the pocket and remapped the sketch to the proper face of the cut. In the sketch editor, the sketch lines now appeared next to the face and had 2 degrees of freedom. I tried to fix the constraints, but could not get the sketch in the correct position on the face.

I'll try your method on the more complicated model tomorrow.
FreeRadical
Posts: 49
Joined: Sun Nov 09, 2014 9:48 pm

Re: Tree rearrangement?

Post by FreeRadical »

ickby wrote:You can also edit the parts used in the boolean operation. For this select the operation in question in the tree view and go to property editor data tab. There you find the entry Base and Tool. If you select it you find a possibility to edit the used parts. Just make sure to hit the recompute button after chaning the parts, than your result will change.
That's interesting. I tried it out, but I'm clearly not understanding it as the result wasn't what I expected. BTW, where is the recompute button?
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Tree rearrangement?

Post by ickby »

it is the button with the two blue arrows which form a cirle, directly next to the workbench switcher.
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: Tree rearrangement?

Post by bejant »

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

Re: Tree rearrangement?

Post by jmaustpc »

This is only not greyed out and f5 only works if some item's property has been marked as "touched", in other words FreeCAD has to think something has changed. Usually I just select some random property of the item I want to recompute, change something then change it back, FreeCAD then recognises that the item's property was touched, then it allows you to recompute the item (not the whole project file).

So in your case where you have changed something, f5 or recompute will be available, but most of the time recomputes are automatic hence the recompute button will most of the time be greyed out.
mario52
Veteran
Posts: 4692
Joined: Wed May 16, 2012 2:13 pm

Re: Tree rearrangement?

Post by mario52 »

hi

So the blue "Recompute" icon Image stayes greyed out this macro force the recompute
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
FreeRadical
Posts: 49
Joined: Sun Nov 09, 2014 9:48 pm

Re: Tree rearrangement?

Post by FreeRadical »

FreeRadical wrote:Thanks, Mark!

I got it to work on the simple model by following your advice (delete the pocket and sketch, attach a new sketch to a face of the most recent tree node, and then did a pad instead of a pocket as this face is the complementary face).
.
.
.
I'll try your method on the more complicated model tomorrow.
It worked on the more complicated model and I 3D printed the file! Thanks, everyone. :D
Post Reply