Scaling a body created from SVG image

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!
TeaMaker
Posts: 6
Joined: Fri Apr 23, 2021 8:51 am

Scaling a body created from SVG image

Post by TeaMaker »

Hi,

rather new here so maybe there's an easy solution to my problem.

I would like to create a fan holder and would like to use a map as inlay.

For this
  • I converted my map into an SVG
  • imported it as geometry
  • extruded the paths (part workbench) into solids
  • performed some Boolean operations
to get the perfect extruded outline of my map :D .

The problem I have is that my map is a factor of 250 too big. I've tried to scale it down by factor of 0.04 using the Draft workbench, and it works great, however this will only let me create a clone ( This object type cannot be scaled directly. Please use the clone method). The clone is the the correct size (or I could adjust it), however the original ginormous maps is also still part of the main body. How can I de-link the clone and turn it into an independent body? Or what else can I do? I can add the small map as an inlay, however I don't know what to do with the big map, not sure how to get rid of it.

Or is there a way to scale down my extruded map without creating a clone? From what I read this isn't possible but maybe I've missed something.

Any help is appreciated.

Sorry, the project file is too big to attach.
OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +148 (Git)
Build type: Release
Branch: Branch_0.19.4
Hash: 476ecf091941bead59b14e44afa6064d5a66afa3
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/Australia (en_AU)
Attachments
snip1.PNG
snip1.PNG (28.35 KiB) Viewed 1151 times
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Scaling a body created from SVG image

Post by easyw-fc »

TeaMaker wrote: Fri May 13, 2022 11:46 am Or is there a way to scale down my extruded map without creating a clone?
clone is the best option imo
https://wiki.freecadweb.org/Draft_Clone
-
draft-clone.scale.png
draft-clone.scale.png (244.88 KiB) Viewed 1136 times
clone-cmd.png
clone-cmd.png (67.15 KiB) Viewed 1136 times
-
there is also Draft Scale cmd
https://wiki.freecadweb.org/Draft_Scale
jeno
Veteran
Posts: 1820
Joined: Sun Jun 29, 2014 10:41 am

Re: Scaling a body created from SVG image

Post by jeno »

TeaMaker wrote: Fri May 13, 2022 11:46 am Hi,
rather new here so maybe there's an easy solution to my problem.
I would like to create a fan holder and would like to use a map as inlay.

For this
  • I converted my map into an SVG
  • imported it as geometry
  • extruded the paths (part workbench) into solids
  • performed some Boolean operations
to get the perfect extruded outline of my map :D .

The problem I have is that my map is a factor of 250 too big. I've tried to scale it down by factor of 0.04 using the Draft workbench, and it works great, however this will only let me create a clone ( This object type cannot be scaled directly. Please use the clone method). The clone is the the correct size (or I could adjust it), however the original ginormous maps is also still part of the main body. How can I de-link the clone and turn it into an independent body? Or what else can I do? I can add the small map as an inlay, however I don't know what to do with the big map, not sure how to get rid of it.

Or is there a way to scale down my extruded map without creating a clone? From what I read this isn't possible but maybe I've missed something.

Any help is appreciated.

Sorry, the project file is too big to attach.
...
I would scale the svg to the needed dimensions so tweaking in FreeCAD is not necessary.
By the way, either it is 250 times to big then the factor is 0.004 or it is 25 times to big and the factor is 0.04 ... and I miss Tasmania ;)
Sorry, couldn't resist.

cheers
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Scaling a body created from SVG image

Post by heda »

2nd that scaling should be done outside of fc if possible (inkscape should work for that).

draft scale chokes on wires and arcs (so there is room for improvement here...)
one have to completely break it up and convert arcs to bsplines and then rejoin things.

it depends on what one gets after import, but first on the agenda is to break it down (draft/downgrade) to single segment entities.
if one then applies draft/upgrade it might be that an edge becomes a line, or an arc etc.

if it is an arc it has to be made into a bspline, coding wise it looks like this...

Code: Select all

import Draft

thearc = App.ActiveDocument.Arc # or whatever name the arc object has
Draft.makeBSpline(thearc.Shape.discretize(5) # or whatever number of points one prefer
App.ActiveDocument.recompute() # the approximate arc should now show
once all single segments are scalable, do the draft/scale
then you can start building your extrusion as if it was imported correctly the first time around.
(probably first one would join the single segments into larger ones...)

the attached file has some different stages in what needs to be done (and the result of it)
Attachments
draftscale.FCStd
(23.63 KiB) Downloaded 17 times
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Scaling a body created from SVG image

Post by chrisb »

easyw-fc wrote: Fri May 13, 2022 12:13 pm clone is the best option
How did get that old clone icon? Or do you run a very old version?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
TeaMaker
Posts: 6
Joined: Fri Apr 23, 2021 8:51 am

Re: Scaling a body created from SVG image

Post by TeaMaker »

chrisb wrote: Fri May 13, 2022 10:52 pm
easyw-fc wrote: Fri May 13, 2022 12:13 pm clone is the best option
How did get that old clone icon? Or do you run a very old version?
Would prefer that clone icon as well, is there a way to customise/change it?
TeaMaker
Posts: 6
Joined: Fri Apr 23, 2021 8:51 am

Re: Scaling a body created from SVG image

Post by TeaMaker »

jeno wrote: Fri May 13, 2022 2:42 pm
TeaMaker wrote: Fri May 13, 2022 11:46 am Hi,
rather new here so maybe there's an easy solution to my problem.
I would like to create a fan holder and would like to use a map as inlay.

For this
  • I converted my map into an SVG
  • imported it as geometry
  • extruded the paths (part workbench) into solids
  • performed some Boolean operations
to get the perfect extruded outline of my map :D .

The problem I have is that my map is a factor of 250 too big. I've tried to scale it down by factor of 0.04 using the Draft workbench, and it works great, however this will only let me create a clone ( This object type cannot be scaled directly. Please use the clone method). The clone is the the correct size (or I could adjust it), however the original ginormous maps is also still part of the main body. How can I de-link the clone and turn it into an independent body? Or what else can I do? I can add the small map as an inlay, however I don't know what to do with the big map, not sure how to get rid of it.

Or is there a way to scale down my extruded map without creating a clone? From what I read this isn't possible but maybe I've missed something.

Any help is appreciated.

Sorry, the project file is too big to attach.
...
I would scale the svg to the needed dimensions so tweaking in FreeCAD is not necessary.
By the way, either it is 250 times to big then the factor is 0.004 or it is 25 times to big and the factor is 0.04 ... and I miss Tasmania ;)
Sorry, couldn't resist.

cheers
I suspected there was something not quite right with the two scaling factors but it was too late to worry about exact details :)

I thought vector graphics were scale independent so I didn't investigate scaling before loading but will have a look whether Inkscape can help me with that. And who knows, it might even find Tasmania (but not many would notice anyway) :D
TeaMaker
Posts: 6
Joined: Fri Apr 23, 2021 8:51 am

Re: Scaling a body created from SVG image

Post by TeaMaker »

Ok, looks like I've been able to solve the problem.

I've ended up scaling the SVG image outside of FreeCad and then imported it, from where I then created the solid I need. This definitely works as a process and yields the desired result.

However, in general this is not a great way of doing it as the object can't be scaled in FreeCad to fit a given size. So if you need to have the object exactly fit into a given space then you'll have to work out the exact scaling factor beforehand (you could use the drawing toolbox as described above) and then scale the SVG using that exact factor. In my case this wasn't an issue as I had room to play with.

Thanks a lot everyone for the help :)
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Scaling a body created from SVG image

Post by easyw-fc »

chrisb wrote: Fri May 13, 2022 10:52 pm How did get that old clone icon? Or do you run a very old version?
I had the old icon in the FC Macro recording settings path.. this path seems to be loaded before internal resources
Moving away the svg icon from that Macro path, FC will show the right icon
TeaMaker wrote: Sun May 15, 2022 4:19 am Would prefer that clone icon as well, is there a way to customise/change it?
you can find the old version here
https://wiki.freecadweb.org/File:Draft_Clone.svg
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Scaling a body created from SVG image

Post by adrianinsaval »

:lol: I'm conflicted, dolly is a nice reference but the star wars clone is likely more recognizable as a clone and kinda cool, but then how long until we get a Disney cease and desist :lol:
TeaMaker wrote: Sun May 15, 2022 4:46 am However, in general this is not a great way of doing it as the object can't be scaled in FreeCad to fit a given size. So if you need to have the object exactly fit into a given space then you'll have to work out the exact scaling factor beforehand (you could use the drawing toolbox as described above) and then scale the SVG using that exact factor. In my case this wasn't an issue as I had room to play with.
Can't you make a Part simple copy of the clone and then delete the clone and the original object?
Post Reply