Mirror along plane, weird behaviour

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!
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Mirror along plane, weird behaviour

Post by GeneFC »

naasking wrote: Tue Sep 28, 2021 3:44 pm 6. Click "Create a new sketch". Bizarreness ensues.
I suggest you read (or reread) the wiki regarding this command.

https://wiki.freecadweb.org/Sketcher_MapSketch

Particularly the part that says,

Please note that this tool is not used to create new sketches. It only maps, or remaps an existing sketch to the face of a solid or a PartDesign feature.

As I said above it is no longer considered good practice to map sketches to faces. This command goes back a long time, but it is not a "best practice".

Gene
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Mirror along plane, weird behaviour

Post by Shalmeneser »

Other way to do it :

Code: Select all

 └ Body (Body)
    ├ Pad (Pad)                     SQUARE
    │  └ Sketch (Sketch)
    ├ Pad001 (Pad)               1 T OUTSIDE
    │  └ Sketch001 (Sketch)
    ├ Pocket (Pocket)            1 T INSIDE
    │  └ Sketch002 (Sketch)
    └ MultiTransform (MultiTransform)
       ├ LinearPattern (LinearPattern)       
       └ PolarPattern (PolarPattern)
Attachments
Capture du 2021-09-28 18-55-37.png
Capture du 2021-09-28 18-55-37.png (3.08 KiB) Viewed 1467 times
Modular Drawers _SHALM.FCStd
(74.26 KiB) Downloaded 20 times
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

TheMarkster wrote: Tue Sep 28, 2021 4:30 pm I would use point on edge constraint or sometimes select the point and the origin and apply a horizontal/vertical constraint to both of them.
I think that's what I did. I think the only zero constraints I have are between a few points and the origin. I don't think I've applied a zero length constraint to a line or anything else, unless I did this accidentally somehow. I appreciate the tips!
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

Shalmeneser wrote: Tue Sep 28, 2021 4:54 pm Other way to do it :

Code: Select all

 └ Body (Body)
    ├ Pad (Pad)                     SQUARE
    │  └ Sketch (Sketch)
    ├ Pad001 (Pad)               1 T OUTSIDE
    │  └ Sketch001 (Sketch)
    ├ Pocket (Pocket)            1 T INSIDE
    │  └ Sketch002 (Sketch)
    └ MultiTransform (MultiTransform)
       ├ LinearPattern (LinearPattern)       
       └ PolarPattern (PolarPattern)
Thanks, you might have anticipated where I was going with this. I got the mirror approach working fine but it obviously doesn't work for non-squares with arbitrary width/height. My goal is to make this parametric in width and height with an input for the number of repetitions of the base dimensions. The linear pattern helps with repeating pillars and pockets along one edge, but the polar pattern doesn't seem to work either if I'm not working with a square:
polar non-square.png
polar non-square.png (7.08 KiB) Viewed 1351 times

Any thoughts on how to get this to work without duplicating the sketch along the adjacent edge from scratch?
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Mirror along plane, weird behaviour

Post by Shalmeneser »

If the rectangle is not a square, symmetry or rotation cannot work. And the linearPattern must be different along each axis.

You can duplicate the 1st T or ⊥ :
* create a new sketch
* Sketcher_CarbonCopy the original sketch. (It will duplicate all the constrains from the 1st sketch : geometric and dimensionnal constraints)
* modify the attachment of the 2nd sketch (using expressions)

then
* LinearPattern along the first axis
* LinearPattern along the second axis
Bance
Veteran
Posts: 4186
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Mirror along plane, weird behaviour

Post by Bance »

Here is an example, as Shalmeneser describes:-
boxBance.FCStd
(113.33 KiB) Downloaded 26 times

You can play around a bit with spacing's, and add the pockets in the same way.
naasking
Posts: 28
Joined: Tue Sep 28, 2021 12:28 pm

Re: Mirror along plane, weird behaviour

Post by naasking »

GeneFC wrote: Tue Sep 28, 2021 4:46 pm Please note that this tool is not used to create new sketches. It only maps, or remaps an existing sketch to the face of a solid or a PartDesign feature.
Thanks, that clarifies where the circular reference was probably coming from. So basically it should be "create sketch" and then "map sketch". Seems like that combination would be pretty common. I find myself reaching for that a lot anyway, but I'm still learning so maybe there's a better way.

Thanks Bance and Shalmeneser, I figured there must be a way to copy or link sketches to build up more complex features but hadn't come across that yet. I suppose my only remaining question is whether there's some way to define the pillar/pocket feature only once, and then "apply" it to a carbon copied sketch (possibly with rotations or other transformations), or something along those lines. Not a big deal to duplicate this tiny feature, but if there is a best practice for this that could save a lot of time going forward. If this is what you did then I'll have to play around with carbon copy some more and see if I can figure it out.

What is the "PropertyBag" in the sample you provided Bance? I've been searching and googling for those properties and can't seem to find anything like that, except maybe the external DynamicData workbench. Is that what it's from?
Bance
Veteran
Posts: 4186
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Mirror along plane, weird behaviour

Post by Bance »

It's from Path WB, no docs yet.

You can use attachment, for the sketches.

Basic_Attachment_Tutorial

Discussion thread for problems - https://forum.freecadweb.org/viewtopic.php?f=36&t=53095
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Mirror along plane, weird behaviour

Post by Shalmeneser »

Code: Select all

 └ Body (Body)
    ├ Origin (Origin)
    ├ Pad (Pad)
    │  └ Sketch (Sketch)
    ├ Pad001 (Pad)                           T
    │  └ Sketch001 (Sketch)
    ├ Pocket (Pocket)                       ⊥
    │  └ Sketch002 (Sketch)
    ├ LinearPattern (LinearPattern)
    ├ Binder (Binder)                         = sketch001 rotate & offset
    ├ Binder001 (Binder)                   = sketch002 rotate & offset
    ├ Pad002 (Pad)
    ├ Pocket001 (Pocket)
    └ LinearPattern001 (LinearPattern)
Attachments
Modular Drawers _SHALMv2.FCStd
(165.08 KiB) Downloaded 18 times
Post Reply