Parametric Mirror Plane / Line?

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!
Post Reply
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Parametric Mirror Plane / Line?

Post by paullee »

Hi, I am trying if I can make a mirror with a mirror plane that is reference to an external line / sketch etc. (Draft mirror seem identical to Part mirror right?) ...

so that if I move / edit this external line / sketch (which act as the mirror plane), the mirror object update accordingly.


As a first attempt, i try referencing the x-coordinate of the base plane of the mirror object to a sketch.constraints.x as indicated in the screen capture but fails with "Unit Mismatch between Result and Required Units".

Any idea? Thanks!
Screenshot from 2017-03-24 02-09-26.png
Screenshot from 2017-03-24 02-09-26.png (176.03 KiB) Viewed 1609 times
Attachments
Test _ Parametric Mirror.fcstd
(9.11 KiB) Downloaded 40 times
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Parametric Mirror Plane / Line?

Post by DeepSOIC »

AFAIK, impossible. Time to write a macro...
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Parametric Mirror Plane / Line?

Post by paullee »

DeepSOIC wrote:AFAIK, impossible. Time to write a macro...
Thanks!

I have not found any documentation on Cad-Data that can be referenced in an expression... so I can only test in the formula / expression field by its automatic fill-in feature.

Anyone has any ideas about that Cad-Data?


(These are what I can find -
https://www.freecadweb.org/wiki/Expressions
https://www.freecadweb.org/wiki/Spreadsheet_Workbench )

Now I am attempting picking up idea of construction geometry again in your hint in https://forum.freecadweb.org/viewtopic.php?t=16178.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Parametric Mirror Plane / Line?

Post by paullee »

DeepSOIC wrote:AFAIK, impossible. Time to write a macro...
Strange, upon further test, I find the following 'inconsistencies':-

Q1 - Whilst I CanNot reference the sketch.constraints.x to the Base-X of Mirror, it CAN be referenced in the Position-X of the Mirror !!??
Q2 - The same sketch sketch.shape.length CAN be referenced in the Base-X of Mirror (It has no unit in the spreadsheet) !?
(This is a GOOD thing as I can do something here :) )

See the following screen capture and FCStd file.
Screenshot from 2017-03-25 16-17-26.png
Screenshot from 2017-03-25 16-17-26.png (151.17 KiB) Viewed 1536 times
Screenshot from 2017-03-25 16-11-16.png
Screenshot from 2017-03-25 16-11-16.png (189.62 KiB) Viewed 1536 times
Regards


OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10634 (Git)
Build type: Unknown
Branch: master
Hash: abe15bbd83671b24f9fadc7a064d8baf5aa52ff3
Python version: 2.7.13
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
Attachments
Test _ Conditional Expression _ rev 2.fcstd
(7.61 KiB) Downloaded 44 times
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Parametric Mirror Plane / Line?

Post by paullee »

Hi,

With some hints from kind peoples here like DeepSOIC, salp, eivindkvedalen, I make a 'solution' in a convoluted way.

See anyone has comments or suggestion.

The Sketch line is a 'reference' mirror line. The black colour ArchWall is a mirror of the white colour ArchWall.

Edit the Sketch reference mirror line and exit. The back ArchWall will be updated according to the Sketch line.

I am checking if there is any 'bug', it works on XY - plane only.

Cheers

Screenshot from 2017-03-26 08-55-43.png
Screenshot from 2017-03-26 08-55-43.png (155.79 KiB) Viewed 1501 times
Edit the Sketch
Screenshot from 2017-03-26 08-56-29.png
Screenshot from 2017-03-26 08-56-29.png (159.76 KiB) Viewed 1501 times
Exit
Screenshot from 2017-03-26 08-56-39.png
Screenshot from 2017-03-26 08-56-39.png (156.54 KiB) Viewed 1501 times
Attachments
Test _ Parametric Mirror _ rev 5 _ part _ OK.fcstd
(9.33 KiB) Downloaded 45 times
Post Reply