I need to put a picture (jpg, gif, png, whatever...) on the side of a cylinder. Is there a way to do this?
All I've been able to find with searching don't involve a picture file.
Any ideas?
Thanks.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 (Git)
Build type: Release
Branch: master
Hash: b2ca86d8d72b636011a73394bf9bcdedb3b109b7
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
solved: wrapping a picture file onto a cylinder
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!
solved: wrapping a picture file onto a cylinder
Last edited by byakk0 on Tue Jan 04, 2022 8:54 pm, edited 1 time in total.
~~Hazen
Re: wrapping a picture file onto a cylinder
- Use Inkscape - another Free program - to create an SVG from yur picture
- import it to FreeCAD
- create a sketch from it Draft->Draft2Sketch
- Use addon Curves workbench to map the sketch on the cylinder.
- import it to FreeCAD
- create a sketch from it Draft->Draft2Sketch
- Use addon Curves workbench to map the sketch on the cylinder.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: wrapping a picture file onto a cylinder
Sweet.
Thanks Chris! I'll give that a try and get with you.
Thanks Chris! I'll give that a try and get with you.
~~Hazen
Re: wrapping a picture file onto a cylinder
I finally got a chance to play with this a little. (It's a side project of no particular importance, hench the slowness in my reply)
I took your advice and downloaded inkscape and converted the file.
Anyway, I must either be a lunkhead or just missing something entirely.
I haven't played with the draft workbench before...
I selected Draft workbench-->new.
Imported the SVG file as a drawing. (there is an option to import as SVG. would this be better?)
Now I have a blank draft layout and a tab with the image file.
All the icons are currently greyed out. How do I get the image file moved over to the draft tab, and then convert it to a sketch?
The draft draft2sketch in the wiki doesn't tell me much. https://wiki.freecadweb.org/Draft_Draft2Sketch
Thanks again.
I took your advice and downloaded inkscape and converted the file.
Anyway, I must either be a lunkhead or just missing something entirely.
I haven't played with the draft workbench before...
I selected Draft workbench-->new.
Imported the SVG file as a drawing. (there is an option to import as SVG. would this be better?)
Now I have a blank draft layout and a tab with the image file.
All the icons are currently greyed out. How do I get the image file moved over to the draft tab, and then convert it to a sketch?
The draft draft2sketch in the wiki doesn't tell me much. https://wiki.freecadweb.org/Draft_Draft2Sketch
Thanks again.
- Attachments
-
- F19screenshot.png (141.15 KiB) Viewed 1586 times
~~Hazen
Re: wrapping a picture file onto a cylinder
You have to import "SVG as geometry".
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: wrapping a picture file onto a cylinder
Thanks.
That worked, but I also discovered I had a problem somehow with the SVG file I was using. I picked a different file and it worked.
I also used the help of another post I stumbled across, https://forum.freecadweb.org/viewtopic.php?t=29704
I can see how this would be useful for other projects, but the one I'm currently doing I just simply need a picture/photograph wrapped onto a cylinder. It sounds as if that isn't possible at this point with Freecad. I'll have to do this in Blender
That worked, but I also discovered I had a problem somehow with the SVG file I was using. I picked a different file and it worked.
I also used the help of another post I stumbled across, https://forum.freecadweb.org/viewtopic.php?t=29704
I can see how this would be useful for other projects, but the one I'm currently doing I just simply need a picture/photograph wrapped onto a cylinder. It sounds as if that isn't possible at this point with Freecad. I'll have to do this in Blender
~~Hazen
-
- Veteran
- Posts: 5505
- Joined: Thu Apr 05, 2018 1:53 am
Re: wrapping a picture file onto a cylinder
Attach the file and the svg if you are interested in seeing if it can be done in FreeCAD. You are wanting to change the geometry of the face by cutting or fusing geometry converted from the image or are you wanting simply to have the image on the face for the purpose of making an image of the model?byakk0 wrote: ↑Tue Jan 04, 2022 8:53 pm Thanks.
That worked, but I also discovered I had a problem somehow with the SVG file I was using. I picked a different file and it worked.
I also used the help of another post I stumbled across, https://forum.freecadweb.org/viewtopic.php?t=29704
I can see how this would be useful for other projects, but the one I'm currently doing I just simply need a picture/photograph wrapped onto a cylinder. It sounds as if that isn't possible at this point with Freecad. I'll have to do this in Blender
If you just want the image, try this macro: (Usage: select object, run macro, select image file)
Code: Select all
import FreeCADGui
from PySide import QtGui
from pivy import coin
# get a jpg filename
jpgfilename = QtGui.QFileDialog.getOpenFileName(Gui.getMainWindow(),'Open image file','*.*')
# apply textures
for obj in FreeCADGui.Selection.getSelection():
rootnode = obj.ViewObject.RootNode
tex = coin.SoTexture2()
tex.filename = str(jpgfilename[0])
rootnode.insertChild(tex,1)
if obj.ViewObject.Transparency == 0:
obj.ViewObject.Transparency = 1
Re: solved: wrapping a picture file onto a cylinder
Just putting on image on the side of a cylinder.
Like a lable on a jar, or maybe even a Pringles can.
I don't need to do anything with geometries in said image.
I'll dig up the files if need be.
Like a lable on a jar, or maybe even a Pringles can.
I don't need to do anything with geometries in said image.
I'll dig up the files if need be.
~~Hazen
Re: solved: wrapping a picture file onto a cylinder
Probably use this? https://github.com/furti/FreeCAD-ArchTextures Check the Readme there to see how it works.