I have a heightmap (grayscale bitmap) that I want to use in FreeCAD. Is it possible to add that in as a model? I am fairly new to FreeCAD. Thanks in advance.
Version: 0.18
Rev Number:
OS: Debian 10 64-bit
Model Heightmap
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
Model Heightmap
Last edited by makafaka on Wed Oct 27, 2021 11:22 pm, edited 2 times in total.
Re: Model Heightmap
"Latest version of FreeCAD" isn't detailed enough. Please have a look at the big red banner at the top.
Regards / Viele Grüße
Max
Max
Re: Model Heightmap
Maybe with the Lithophane external workbench?:
https://github.com/furti/FreeCAD-Lithophane
https://github.com/furti/FreeCAD-Lithophane
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Model Heightmap
The macro FCBmpImport can import gray scale bmp as lithophane, too. Each pixel gets a height based on the level of black or white in that pixel. I haven't used the workbench, so I don't know which will give better results. If the resolution is too high the macro will probably bog down FreeCAD with too many objects. If you can post the file I'll give it a go with macro.
Re: Model Heightmap
This appears to be Windows only. I tried it, it will import the image, but won't convert it to a lithophane successfully. It returns an empty object when I click "create the geometry .. shape of box" button.Roy_043 wrote: ↑Wed Oct 27, 2021 7:22 am Maybe with the Lithophane external workbench?:
https://github.com/furti/FreeCAD-Lithophane
According to the git and my attempts with this addon, this will only work in BW images, which have 1-bit per pixel. This means that pixels must be one of two values: 0 or 1. Greyscale images have 8 bit precision, which means there are 256 values a pixel can take.TheMarkster wrote: ↑Wed Oct 27, 2021 7:57 pm The macro FCBmpImport can import gray scale bmp as lithophane, too. Each pixel gets a height based on the level of black or white in that pixel. I haven't used the workbench, so I don't know which will give better results. If the resolution is too high the macro will probably bog down FreeCAD with too many objects. If you can post the file I'll give it a go with macro.
I don't really have a specific image file or FreeCAD document file, I am more just asking if any version of FreeCAD or any Addon/Macro supports this specific feature. If this doesn't exist, I will just create it. I am just new to the software, so I wanted to make sure that there is none existing in the community first.
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Model Heightmap
makafaka wrote: ↑Wed Oct 27, 2021 11:37 pm
According to the git and my attempts with this addon, this will only work in BW images, which have 1-bit per pixel. This means that pixels must be one of two values: 0 or 1. Greyscale images have 8 bit precision, which means there are 256 values a pixel can take.
I don't really have a specific image file or FreeCAD document file, I am more just asking if any version of FreeCAD or any Addon/Macro supports this specific feature. If this doesn't exist, I will just create it. I am just new to the software, so I wanted to make sure that there is none existing in the community first.
- Attachments
-
- Snip macro screenshot-6191f2.png (38.89 KiB) Viewed 1277 times
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Model Heightmap
I doubt if the workbench is windows only. It might be just not compatible with 0.18, which is fairly outdated by this point. I suggest trying one of the AppImages of 0.20. I imported this a few minutes ago:
Original png was converted to grayscale bmp and resized down to around 200x230 or something like that. The FreeCAD file is too large for the forum.
I made a compound of the line objects, and then a draft clone of the compound, which I scaled up in the z direction to create more contrast.
A warning with the macro, if you start getting errors in the report view abort the operation immediately with the abort button. Force kill FreeCAD if you have to. I have had it crash not just FreeCAD, but the entire system. Save and save often.
Original png was converted to grayscale bmp and resized down to around 200x230 or something like that. The FreeCAD file is too large for the forum.
I made a compound of the line objects, and then a draft clone of the compound, which I scaled up in the z direction to create more contrast.
A warning with the macro, if you start getting errors in the report view abort the operation immediately with the abort button. Force kill FreeCAD if you have to. I have had it crash not just FreeCAD, but the entire system. Save and save often.
- Attachments
-
- Thomas_Jefferson_-_headshot.png (155.55 KiB) Viewed 1258 times
Re: Model Heightmap
This worked! Thank you!TheMarkster wrote: ↑Thu Oct 28, 2021 12:47 am I doubt if the workbench is windows only. It might be just not compatible with 0.18, which is fairly outdated by this point. I suggest trying one of the AppImages of 0.20. I imported this a few minutes ago:
Original png was converted to grayscale bmp and resized down to around 200x230 or something like that. The FreeCAD file is too large for the forum.
I made a compound of the line objects, and then a draft clone of the compound, which I scaled up in the z direction to create more contrast.
A warning with the macro, if you start getting errors in the report view abort the operation immediately with the abort button. Force kill FreeCAD if you have to. I have had it crash not just FreeCAD, but the entire system. Save and save often.