Closed jdegenstein closed 6 months ago
I was about to suggest this too, but I would generalize to import textured meshes to use as a reference while designing. This would be interesting for loading 3D scans or other models without losing texture information.
There could be a helper function for loading an image that would create the model described above and load it as a textured mesh.
fixed in 2.2.2
Like many other CAD software it would be great to import a raster image into OCP CAD Viewer. That way you could take a photo of a real-life object, import/rescale in OCP CAD Viewer, and then design/sketch on top of the image in build123d/CQ. Flatbed scanners can be really good sources of reference images as well.
Desired features:
As far as ThreeJS is concerned, here is a working example someone created of loading an image onto a plane as a texture: https://codepen.io/duhaime/pen/jaYdLg
I suggest looking at the Python Pillow library (there may be lighter weight alternatives). This may be relevant for encoding an image to an IO object in memory. https://pillow.readthedocs.io/en/latest/reference/Image.html#PIL.Image.Image.tobytes
This SO question may also be relevant: https://stackoverflow.com/questions/27826422/get-binary-image-data-from-pil-image