Seeking help on modifying an existing model - part 1

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!
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Seeking help on modifying an existing model - part 1

Post by falviani »

Hi,

My setup:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22319 (Git)
Build type: Release
Branch: master
Hash: 33ef4e0e35fba74c6e2fa3829cfd15c4b6f67e94
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

Background: The model is for an air-assist mount for a laser engraver. It fits over the top of the tool head shown below - over the x-axis motor in the back and around so the trough holding a 1/4" airbrush hose goes down on the right side of the laser diode enclosure.
LaserHead_closeup.png
LaserHead_closeup.png (263.11 KiB) Viewed 898 times
The nozzle must be correctly aligned with the laser beam in order to be effective. I discovered when this was installed that the nozzle was 2mm away from the beam, and so need to move the trough 2mm closer to the "front" (where the motor is).
Virtually all work was done in the part design and sketcher workbenches. Almost all dimensions are defined in the spreadsheet and referenced in the dimensional constraints.

The problem: The trough is an additive loft of 3 identical sections. I did this first to get the geometry correct, then added the other pieces from an earlier design (by moving the dimensions over and rebuilding the geometry). As such, from the top the sketch was aligned with the XY axes. The model before the move is this:
AirAssistMount_beforeMovingTrough.png
AirAssistMount_beforeMovingTrough.png (35.46 KiB) Viewed 898 times
To move it I needed to unanchor it from the axis (removing a couple of lines), use construction lines to reposition it, then rebuild the lines to complete the sketch. This is shown below.
AirAssistMount_LoftSectionMovement.png
AirAssistMount_LoftSectionMovement.png (19.75 KiB) Viewed 898 times
The same procedure was used for all 3 sections. After moving the sections, several sketches were moved. Since I can only attach 5 files to a post. I'll attach the "after" image in a followup post.

Note: the log had a number of entries as follows: "SketchObject::onChanged(): Unmanaged change of Constraint Property results in invalid constraint indices". I don't know if these are important, but look like data warnings.

My questions are:
(1) Is there a clear problem with my workflow? If so, what it is and what changes do I need to make? I am attaching sketches strictly to datum planes, moving and rotating them as needed for positioning - there are no sketches attached to faces.
2) If the workflow looks OK, is this a bug?

Thanks in advance,
Frank Alviani
Attachments
AirAssistMount_1-4_v2c_afterMovingTrough.FCStd
(155.96 KiB) Downloaded 20 times
AirAssistMount_1-4_v2c_b4.FCStd
(145.48 KiB) Downloaded 24 times
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Seeking help on modifying an existing model - part 2

Post by falviani »

HI,

This is just to add the "after" image I couldn't add to the initial post (evidently there's a 5 file limit):
AirAssistTrough_afterMovingTrough.png
AirAssistTrough_afterMovingTrough.png (24.36 KiB) Viewed 897 times
While the sketch in white is shown correctly aligned, the top plate has been moved so the trough is almost all the way towards the back of the plate, rather than being near the outer edge. Also, a number of other sketches have also moved as a result of the repositioning of the trough.

Thanks for your help!
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Seeking help on modifying an existing model - part 1

Post by drmacro »

When I look at your dependency graph I see two things.

1. You have used generated geometry to attach down tree sketches. Thus invoking the wrath of the topological naming gods when you attempt to modify up tree sketches. This is recommended against.

2. There are red lines indicating, in this case dependencies on sketches outside the Body (troughtest), specifically Sketch004 (troughEnd001 is "not of the body" (...sorry StartTrek reference...) 8-) )

Sorry, that's as far I can get at the moment, I'm late already for a meeting... :(
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Seeking help on modifying an existing model - part 2

Post by chrisb »

Please add a link to your initial post.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Seeking help on modifying an existing model - part 1

Post by chrisb »

I have merged both topics.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: Seeking help on modifying an existing model - part 1

Post by falviani »

"You have used generated geometry to attach down tree sketches. Thus invoking the wrath of the topological naming gods when you attempt to modify up tree sketches. This is recommended against."

I'm sorry, I've never heard of this before. Could you please explain? How do I design a model so that feature X is exactly a specific distance from feature Y if I can't reference feature Y? I have learned to never attach a sketch to a face, using only datum planes.

Thanks in advance. So many of the posts on this board make sweeping assumptions about the knowledge level of the people asking for help, and the documentation often doesn't help. I searched the documentation for "generated geometry" and got 0 hits for that term :cry:
chrisb
Veteran
Posts: 53922
Joined: Tue Mar 17, 2015 9:14 am

Re: Seeking help on modifying an existing model - part 1

Post by chrisb »

falviani wrote: Thu Sep 03, 2020 10:54 pm I have learned to never attach a sketch to a face, using only datum planes.
There is nothing gained if you attach the DatumPlanes to faces. Have a look at this page, especially the paragraph about creating stable models.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Seeking help on modifying an existing model - part 1

Post by drmacro »

falviani wrote: Thu Sep 03, 2020 10:54 pm "You have used generated geometry to attach down tree sketches. Thus invoking the wrath of the topological naming gods when you attempt to modify up tree sketches. This is recommended against."

I'm sorry, I've never heard of this before. Could you please explain? How do I design a model so that feature X is exactly a specific distance from feature Y if I can't reference feature Y? I have learned to never attach a sketch to a face, using only datum planes.

Thanks in advance. So many of the posts on this board make sweeping assumptions about the knowledge level of the people asking for help, and the documentation often doesn't help. I searched the documentation for "generated geometry" and got 0 hits for that term :cry:
Generated geometry is anything FreeCAD created for you. Faces and edges of a pad are generated geometry.

Sketches can be attached with an offset. In the property view see the Attachment section. You can move the sketch along any axis and rotate it around any axis.

You reference geometry from other sketches (you could also reference generated geometry, but that is what you should avoid).

See example models here: https://forum.freecadweb.org/viewtopic. ... se#p391998

And: https://forum.freecadweb.org/viewtopic. ... t=Exercise

And: https://forum.freecadweb.org/viewtopic. ... 10#p390066
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
falviani
Posts: 250
Joined: Tue May 07, 2019 8:49 pm

Re: Seeking help on modifying an existing model - part 1

Post by falviani »

Thanks for the insights, folks!

Before anything else - my current plan is to watch many of the video tutorials referenced from the forum page, particularly those demonstrating 0.19, which is the only version I use (built from source). I am still climbing a steep learning curve, I'm afraid; my background is not in mechanical design, but 50 years as a programmer.

chrisb - I have checked all of the datum planes in my model, and with one exception they are anchored to a base plane, I think:

SupportSample1.png
SupportSample1.png (53.89 KiB) Viewed 792 times
SupportSample2.png
SupportSample2.png (22.08 KiB) Viewed 792 times

I will fix the one datum plane attached to a pad.

drmacro - I'm afraid it's unclear to me how to restrict my references to another sketch when editing. I hope to find that out from the video tutorials. I often find the 'copy' tool in the part design workbench won't work with the sketch I want to copy in for reference, for reasons I don't understand.

In general, do you have any hints as to what caused the main plate sketch to shift when I changed the sketches for the additive loft? I find that mysterious.

I still have 2 questions about log/report messages:
1) "PartDesign::AdditiveLoft / AdditiveLoft: Links go out of the allowed scope". Hopefully rebuilding the model will alleviate this - but what is the 'allowed scope'?
2) "SketchObject::onChanged(): Unmanaged change of Constraint Property results in invalid constraint indices" - this is completely obscure. Is this due to sketches that are not completely constrained?

I hope to have improved the model after this. I expect I may need to rebuild the model again :(

Thanks again!
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Seeking help on modifying an existing model - part 1

Post by drmacro »

falviani wrote: Fri Sep 04, 2020 3:31 pm
drmacro - I'm afraid it's unclear to me how to restrict my references to another sketch when editing. I hope to find that out from the video tutorials. I often find the 'copy' tool in the part design workbench won't work with the sketch I want to copy in for reference, for reasons I don't understand.
I know of no 'copy' tool in PD workbench. :roll: That doesn't mean there isn't one though... ;)

In any case, the way to reference geometry from other sketches needs some explanation that you my not find in tutorials, or may not recognize it when you see it.

- Select the PD workbench, start a new file.
- Create a sketch (it will create a Body for you and the sketch (Sketch) for you on the plane you selected.
- Draw rectangle. Close Sketch.
- Create another sketch on the same plane, it will be named Sketch001.
- Draw a pentagon or some shape other than the one in Sketch. Don't close this sketch.
- now click the Model tab (you are probably in the Tasks tab)
- The first Sketch is gray-ed out. Click on it and hit the space bar. ( You should now see the geometry of Sketch and Sketch001)
- Now click tis icon: Image and hover your mouse over a piece of geometry from Sketch. If you click it will produce a pink line matching the Sketch geometry.
- You can now constrain Sketch001 geometry to the pink line.

Having done that if you now close Sketch001 and open Sketch and change it's length, Sketch001 will update with it.

This is also sometimes called the Master Sketch technique, since you may never pad Sketch.

( Also, with the sketches close, select Sketch001 in the model tree. Look at the properties. Expand the Attachment group and change the Z value. You'll note the sketch moves up the global Z axis.)

There are other techniques as well, spreadsheets, dynamic data, links, shape binders...
In general, do you have any hints as to what caused the main plate sketch to shift when I changed the sketches for the additive loft? I find that mysterious.
When the topo naming issue causes loss of reference the solver can do some seemingly very strange things. That'd be my first inkling... :?
I still have 2 questions about log/report messages:
1) "PartDesign::AdditiveLoft / AdditiveLoft: Links go out of the allowed scope". Hopefully rebuilding the model will alleviate this - but what is the 'allowed scope'?
2) "SketchObject::onChanged(): Unmanaged change of Constraint Property results in invalid constraint indices" - this is completely obscure. Is this due to sketches that are not completely constrained?
First thoughts:
#1 usually happens when you create and reference a sketch that was created outside the Body (i.e. the property value Map Mode is "Deactivated" and Support is blank, typically because the Sketch workbench was used to create the sketch and not the create sketch in Part Design.

#2 typically this indicates the constraint it is complaining about no longer has the face or edge it was referencing. I.e. the topo naming issue.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply