Looking for advice on how to design a case based on existing extrusion (macropad build)

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
Sono
Posts: 3
Joined: Fri Oct 22, 2021 8:40 pm

Looking for advice on how to design a case based on existing extrusion (macropad build)

Post by Sono »

I want to build a small macro pad and went via keyboard-layout-editor.com and then builder.swillkb.com to create a SVG which I then imported into FreeCAD and created an extrusion of 1.5 mm with the cutouts. This is the current state of the file which I attached. I am going to call this the plate part in the post.

What I want to do now is create a case around the plate part, basically a 'box' with a pocket where the outlines follow the shape of the plate part. However, I am having a hard time to create this 'box'. I tried the external geometry tool in the sketcher workbench and wanted to try the Shape Binder (Part Design), but I think I just did not understand it correctly. I'm quite new to 3D Design, therefore I'm thankful for tipps on how to design this.


Details about FreeCAD installtion:
OS: macOS 10.16
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: (HEAD detached at 0.19.2)
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.8
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
Attachments
macro3.FCStd
(81.85 KiB) Downloaded 15 times
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Looking for advice on how to design a case based on existing extrusion (macropad build)

Post by heda »

welcome to the forum
it takes practice, and more of it than one would hope.

first of all, for a simple shape like this, why bother creating such thing in a special tool when it can be done directly in fc, in this case for example the radius of the outline is segmented in your file. the benefit of doing it directly in fc is that when using native fc geometry it becomes easier to modify and adapt if (read when) it is needed, and if one wants a radius, one can make a radius that is not ending up like a segmented one.

it is not hard to create a layout like this directly in fc.

here is one example when making it in draft, main reason for doing it in draft is just to showcase how it could be done in draft.
with a couple of draft/rectangles this is quickly done
have not made the "offset" outline in the attached file, that should really be easy enough for you to do on your own, just use a new rectangle or make a draft/offset.

the workflow in this case:
- switch to wireframe view mode
- make the outer rectangle (and make use of the radius property)
- make the rectangle for the lonely cut and position it
- make the rectangle to be used in the pattern
- make an array in x-direction
- make an array in y-direction and position it (can make use of expressions here to get the position offsets right in an easy way)
- (when draft/array behaves, no need to split the x/y direction of the pattern, see below)
- duplicate all created geometry (just click ok on dependency)
- while all "newly duplicated geometry" is selected press downgrade (works because the rectangles are already with faces)
- switch to "as is" view mode
- you now have a nicely cut surface that can be extruded in part wb, or pd wb for that matter (if doing it in part wb, just remember to tick the checkbox "make solid")
- the downgrade leaves an orphan array in the object tree, that is just to delete, it is not needed.

the created face (subtraction) is not directly parametric, but since the original geometry is still there it is not hard to modify those by altering their height/width and placement if needed, and then just do the duplicate/downgrade to get a new face to extrude.

all of this could of course be done from scratch in for example part design wb, with sketches and patterns/arrays there as well (pretty sure someone will put up an example like that as well)

the reason for making the arrays separate in x and y is your file, dunno why the draft/orthogonal array is broken, when doing a 2d array - the actual array gets a position that seems to be more or less random - that makes the orthogonal array utterly useless in the current state in that file.imho.
not a clue why this is the case, but if I make a new file on my box the draft/orthogonal array works as expected, attaching one of those files as well.

which version of fc are you running?
Attachments
draftarrayworks.FCStd
(11.44 KiB) Downloaded 11 times
macro3_mod.FCStd
(105.27 KiB) Downloaded 11 times
Sono
Posts: 3
Joined: Fri Oct 22, 2021 8:40 pm

Re: Looking for advice on how to design a case based on existing extrusion (macropad build)

Post by Sono »

Thank you very much for ther reply and the extensive guide. I do understand that this shape is indeed quite easys to do in FreeCAD, I just wonder if there is an elegant or at least not tedious way to build based on existing geometry from a SVG file. My example is indeed quite simple in this case, I just wonder how one would go when the starting geometry would be more complex, e.g. the individual squared might not be arranged in a grid pattern, but might be spaced individually.

I'm quite sure my lack of experience and the lack of the correct lingo makes my issue harder to understand, I just thought that there should be a way to "trace" the outline of an existing geometry and then adapt based on that. Ideally I would like to "copy" my outline into a new sketch and then build from that, e.g. making a 2mm rim around the existing contour (when viewed from the top). But maybe this is just not possible easily in CAD.
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Looking for advice on how to design a case based on existing extrusion (macropad build)

Post by heda »

easy or not is in the eyes of the beholder...

Part_Offset2D on the face you have

or since draft is on strike for using it directly run the following in your python console and you can make a draft/offset (on the draft wire)

Code: Select all

>>> import Draft
>>> face = App.ActiveDocument.Face.Shape
>>> Draft.makeWire(face)
<Part::Part2DObject>
>>> App.ActiveDocument.recompute()
and there is always Draft_Draft2Sketch

Snip macro screenshot-0de119.png
Snip macro screenshot-0de119.png (22.56 KiB) Viewed 754 times
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Looking for advice on how to design a case based on existing extrusion (macropad build)

Post by TheMarkster »

You can import svg files as geometry. Each wire would become a path object. You can use Part workbench 2D offset on the paths to offset them 2mm.

You can create a new body, make it active, select the top face of your cut object and make a shapebinder from it.

If you want to offset by 2 mm you can do that with the Part workbench 2D offset tool. WireFilter, a macro in the addon manager (tools menu) can also offset and scale. With WireFilter you can isolate that outer wire. Select the top edge in the 3D view (or any edge of that wire) and run the macro:
Snip macro screenshot-cc8317.png
Snip macro screenshot-cc8317.png (72.04 KiB) Viewed 735 times
That could be padded to make the bottom of a case. Or if you want to make the sides of a case offset a bit from this offset you could scale the WireFilter some small amount, say 1.005, apply the offset of 2.0 and fill the gap between with the Offset Fill option.
Snip macro screenshot-72384f.png
Snip macro screenshot-72384f.png (44.67 KiB) Viewed 735 times
Snip macro screenshot-08ceb7.png
Snip macro screenshot-08ceb7.png (30.76 KiB) Viewed 735 times
The lid can be made with another WireFilter of the same edge of the shapebinder, scaled at 1.005, offset at 2.0, then toggle Follow Source to False and adjust its Z placement to =Pad.Length (or 40 is what I used), and then pad that WireFilter to 2.0 mm.
Snip macro screenshot-4992fe.png
Snip macro screenshot-4992fe.png (58.55 KiB) Viewed 735 times
All of this has been done without ever opening the sketcher. I have attached the file, but you need to install and run the macro and create the file it offers to create before opening it or else the WireFilter objects will be broken.
Attachments
macro3_markster.FCStd
(610.42 KiB) Downloaded 12 times
Sono
Posts: 3
Joined: Fri Oct 22, 2021 8:40 pm

Re: Looking for advice on how to design a case based on existing extrusion (macropad build)

Post by Sono »

Thanks to everyone. I now noticed there are so many tools inside FreeCAD I was not aware of.
I will take an in depth look at all the replies and techniques so I can learn how to handle these things better.
Post Reply