Draft WB Path Array Align problem (0.18 14495)

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!
flim
Posts: 56
Joined: Mon May 07, 2018 8:51 am

Draft WB Path Array Align problem (0.18 14495)

Postby flim » Sun Sep 02, 2018 10:23 am

I cannot make the pieces align the path, if I change Align to true, an exclamation mark shows on PathArray.

How to make the align work properly?
Attachments
TankTracks.FCStd
(75.84 KiB) Downloaded 16 times
TheMarkster
Posts: 1392
Joined: Thu Apr 05, 2018 1:53 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby TheMarkster » Sun Sep 02, 2018 9:48 pm

I think there's a bug in the Draft.py, but there are also other issues with your model according to the Dependency Graph, which shows some red arrows indicating links going out of the allowed scope. For example, you have the Pad as the base of the array, when it should probably be the body instead. You also have a link from a sketch in one body to the array as well as the Pad in the other body to the same array. But despite those issues, it looks "okay" once the bug in Draft.py is fixed and once you modify the attachment of Sketch001, but... you probably need to fix those issues or else they will likely cause more problems later.
tracks-dependency-scr3.png
tracks-dependency-scr3.png (28.28 KiB) Viewed 459 times
First, fix what I believe to be a bug. Open a file called Draft.py in a text editor. This file is found at /Mod/Draft/Draft.py within your FreeCAD folder, wherever you have FreeCAD installed. Go to line 6040 and change it from this:

Code: Select all

        if lnodes != nullv:
to this:

Code: Select all

 
        if not lnodes.isEqual(nullv,1e-7): #was if lnodes != nullv:
        
        
These two lines of code do essentially the same thing except in the original case it's looking for an exact match to nullv, which is 0,0,0 whereas the proposed change will look for a match within 1e-7 (.000001) tolerance and figure that's close enough to be getting on with. This check is there to prevent attempting to normalize a null vector. The #was if... bit isn't absolutely necessary since it's only a comment, but if you need to change it back later you'll have that as a reference.

Next step is to close and reload FreeCAD in order for it to reload that module you just changed.

Now it "works", but you still aren't getting the result you probably want:
tracks-scr.png
tracks-scr.png (74.56 KiB) Viewed 459 times
What's needed now is to adjust Sketch001's placement slightly.
tracks-scr2.png
tracks-scr2.png (74.86 KiB) Viewed 459 times
My FreeCAD video series on youtube: https://www.youtube.com/c/mwganson
flim
Posts: 56
Joined: Mon May 07, 2018 8:51 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby flim » Mon Sep 03, 2018 5:41 am

Thanks for helping on align the pieces.

I am trying to fix my issue but still not get it. Here is the new dependency graph. No matter how I change the structure I still got red line on PathArray.
Attachments
TankTracks2.jpg
TankTracks2.jpg (133.3 KiB) Viewed 445 times
TankTracks2.FCStd
(49.8 KiB) Downloaded 14 times
chrisb
Posts: 24399
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby chrisb » Mon Sep 03, 2018 5:54 am

You must not use anything from inside the body, see TheMarkster's remark.
- You should use Body instead of Pad in the PathArray
- You can create a clone of the sketch Path which lies outside of Body and use that as path for PathArray
- I would rather recommend to place the sketch outside of body and create inside a ShapeBinder.
flim
Posts: 56
Joined: Mon May 07, 2018 8:51 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby flim » Mon Sep 03, 2018 6:48 am

I see, the path sketch should not within any Body.

Now no more red lines in dependency path, the the bodies are not follow along the path correctly.
Attachments
TankTracks3.jpg
TankTracks3.jpg (179.88 KiB) Viewed 434 times
TankTracks3.FCStd
(74.16 KiB) Downloaded 11 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Draft WB Path Array Align problem (0.18 14495)

Postby NormandC » Mon Sep 03, 2018 8:59 am

Unfortunately, creating a PathArray (or any other Draft or Part object) based on a Body makes it "explode" in the dependency graph as shown in your screen capture, but this is a dependency graph bug that has no incidence on the model; if you delete the PathArray, the Body is restored in the graph.
flim
Posts: 56
Joined: Mon May 07, 2018 8:51 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby flim » Mon Sep 03, 2018 9:10 am

How to fix the placement of the array objects to match the path?

So it there other way to make array on path without using Draft WB? I running out of idea.
Last edited by flim on Mon Sep 03, 2018 9:13 am, edited 1 time in total.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Draft WB Path Array Align problem (0.18 14495)

Postby NormandC » Mon Sep 03, 2018 9:12 am

You can use the lattice2 add-on, but I don't know how to use it.
chrisb
Posts: 24399
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby chrisb » Mon Sep 03, 2018 10:21 am

flim wrote:
Mon Sep 03, 2018 9:10 am
How to fix the placement of the array objects to match the path?
You have either to center the Pad to the origin or you attach a DatumPoint to the center of Pad and move the PathArray with the DatumPoints negative coordinates.
Attachments
TankTracks_cb.FCStd
(58.63 KiB) Downloaded 17 times
flim
Posts: 56
Joined: Mon May 07, 2018 8:51 am

Re: Draft WB Path Array Align problem (0.18 14495)

Postby flim » Mon Sep 03, 2018 3:41 pm

I see. Thank you!