Issue #6928 - Computed placement wrong when cloning

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Post Reply
smurfix
Posts: 2
Joined: Thu Dec 12, 2019 11:15 am

Issue #6928 - Computed placement wrong when cloning

Post by smurfix »

Hi,

So I'm in the Parts module. I add a cube and position it based on some formula or other.

Then I go to Parts Design and click Dolly to create a clone, then move the clone around, based on some other formula.

Then I change some variables used in these formulas. Oops, my model is now broken.

The problem is that the clone's original Placement is stored in the copy, using absolute values, not the original formula. Thus, when I change some of the variables which my positioning is based on, the original moves where it's supposed to, but the clone doesn't: its placement is relative to the initial position of the original instead of its current position.

My preferred fix would be for the clone not to have two placements in the first place. It should default to the placement of its parent, using its formulae if applicable, and that's it.

V0.19.

To reproduce:
  • create a variable "off", set it to 1cm
  • create a variable "len", set to 2cm
  • create a cube
  • position the cube with x=off
  • set the cube's x-length to "len"
  • clone the cube
  • position the clone with x="len" so that you now have two consecutive cubes
  • now change "len" and/or change "off"
  • observe that the two cubes no longer align
  • tear out hair
  • either: edit the clone so that its internal "clone###.Placement.Position.x" contains "off" instead of the constant 1
  • or: zero the clone's internal placement entirely and set the body's placement.position.x to "off+len"
  • either way, observe that this construction now works
  • … do the same thing with the umpteen other objects you used to compose your parameterized construction …
I assume that this is a bug and I should go to github and file an issue.
User avatar
Kunda1
Veteran
Posts: 12710
Joined: Thu Jan 05, 2017 9:03 pm

Re: Computed placement wrong when cloning

Post by Kunda1 »

Haven't looked at the details of this post. But I'm curious why it was
1. Not tested on v 0.20dev first?
2. Made into a GitHub ticket without community vetting?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
adrianinsaval
Veteran
Posts: 3156
Joined: Thu Apr 05, 2018 5:15 pm

Re: Computed placement wrong when cloning

Post by adrianinsaval »

What's the gihub issue number?
User avatar
Kunda1
Veteran
Posts: 12710
Joined: Thu Jan 05, 2017 9:03 pm

Re: Computed placement wrong when cloning

Post by Kunda1 »

adrianinsaval wrote: Sun May 29, 2022 5:37 am What's the gihub issue number?
issue #6928
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Veteran
Posts: 12710
Joined: Thu Jan 05, 2017 9:03 pm

Re: Issue #6928 - Computed placement wrong when cloning

Post by Kunda1 »

Updated title to reflect open ticket
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Post Reply