gotcha

Author Topic: Smooth truncated icosahedron  (Read 2000 times)

September 18, 2017, 09:59:30 AM
Read 2000 times

NeckWarmer

  • Guest
Hi, i've a question to all you: i would to make a soccer ball, and to do this i choosen to render a truncated icosahedron. The result is soddisfying but i need to bend the edges of the polyhedron to simulate the sphericity. For the external edge i've used an inscribed circle  but for the internal hexagon and pentagon i don't know how to achieve this. I need  Could you help me? Please suggest me other methods to make a soccer ball.

Thank you

September 19, 2017, 09:27:40 AM
Reply #1

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Hi.

You can select under by Alt+clicking, and/or change the fill&stroke attributes within the group of paths.
For a reference I'd probably use blender to model a ball with more vertices and export an obj file that the extension could call.

Edit: attaching an obj with 4 nodes/face "edges".
« Last Edit: September 20, 2017, 08:48:37 AM by Lazur »

September 19, 2017, 06:53:28 PM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Something is wrong with that zip file.  Windows can unzip at all.  7z extracts it as RAR.  Inside is ball.obj file.  No idea what that is!

Managed to open its code.  Looks like a Blender file?  No wonder -- I don't have Blender installed.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

September 20, 2017, 01:22:54 AM
Reply #3

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Had problems zipping it, so used winrar to convert it to rar, and to zip after -rar is not supported by the forum, not sure why if zip is ok-.
But if you could open the obj, that's a good sign. It was meant to be the obj only which is also an unsupported attachment format.

Obj files are not blender's native format, they are so basic inkscape uses them in the render 3D polyhedron extension.
The built-in obj files are located in inkscape/share/extensions/Poly3DObjects. With the extension settings in the inkscape window when run there is a dropdown list to load them in, and also an option to load from file.
The latter should be used if you not copy/paste the obj file in the aforementioned folder.

Only thing I haven't tested is the scale factor -in blender it was 1700 mm wide, so probably it needs to be scaled down.

September 20, 2017, 04:16:15 AM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
But if you could open the obj, that's a good sign.

Oh, I never saw an image.  I could only open in the browser, and  I only saw a lot of code, with Blender in the header or metadata.....well the top section of the code.

(Guess I could make RAR accepted as attachment.  Just didn't think it would ever be needed.  Why did you use RAR?)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

September 20, 2017, 04:58:30 AM
Reply #5

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
I would also suggest Blender, if you need this as vector paths.  And if you need it very realistic. Or maybe a CAD program could do it???

If raster is acceptable, I think GIMP has a plugin (or maybe it's a script fu?) that can make images look like they are wrapped around a sphere.  But if not GIMP, I'm sure it could be found in some raster editor, just don't know which (if not gimp).

If it does not need to be precisely realistic, the Envelope Deformation LPE could probablly achieve something more or less close to what you need.  But there is no way to be precise with it.  You  just drag handles until it looks about right.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

September 20, 2017, 08:06:27 AM
Reply #6

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Checked the trunc_icos obj file in the Poly3DObjects folder. The ball is 4854 mm wide, so scaled the previously attached obj file accordingly. Here is the updated version:
*ball2.zip
(3.5 kB - downloaded 231 times)


Rar is the default format in win awailable by right click menu. Could figure out this time how to zip it without any rar.

With 2 middle nodes on an "edge" of a "face" of the ball you can set them smooth and add a spiro path to bend edges smoothly.
Not elliptical arcs though, may need some adjustments on the faces near the 3D model's contours.

September 20, 2017, 08:46:59 AM
Reply #7

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
So here is how you can use the obj file in inkscape:



Some years before had taken part of a soccerball design contest, used blender for that to render the 3D -the design was drawn in inkscape.
Not sure if you can open this link, though it would show one example design concept.
example image

September 21, 2017, 06:43:39 PM
Reply #8

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Yes, I can open the soccerball image page.  That's a nice design!

Following your video, when I try to load ball2.obj into the 3D Polyhedron dialog, I get a Traceback error.  Part of the error seems to indicate that Inkscape didn't find ball2.obj in the extensions directory.  Could you have forgotten to mention that part?  I did wonder why I didn't have to tell Inkscape where the file was.  So that must be, at least part of the problem.

The rest of the traceback.....well let's see.  I'll put the file in the extensions folder, to find out how much of the traceback gets fixed, because there are 5 or 6 lines of errors.  Oh geez -- it has to be in the program files directory!  Well no, not that either. I really can only guess what the traceback errors mean. 

Here's the Traceback:

Traceback (most recent call last):
  File "polyhedron_3d.py", line 531, in <module>
    e.affect()
  File "inkex.py", line 283, in affect
    self.effect()
  File "polyhedron_3d.py", line 461, in effect
    get_obj_data(obj, file)#load data from the obj file
  File "polyhedron_3d.py", line 90, in get_obj_data
    infile = open(objfile(name))
IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Inkscape 0.92.2\\inkscape\\share\\extensions\\Poly3DObjects\\ball2.obj'

Is that anything I can fix myself?

(btw, moving this to the advanced board - links will be provided)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

September 22, 2017, 12:46:44 AM
Reply #9

Lazur

  • IC Mentor

  • Offline
  • ******
  • Inkscape Filters Wizard

  • 1,154
  • Gender
    Male

    Male
Besides moving the file into the "C:\\Program Files\\Inkscape 0.92.2\\inkscape\\share\\extensions\\Poly3DObjects\\" folder? No, that should do it as seen in the video.

Part of the error seems to indicate that Inkscape didn't find ball2.obj in the extensions directory.  Could you have forgotten to mention that part?


The built-in obj files are located in inkscape/share/extensions/Poly3DObjects. With the extension settings in the inkscape window when run there is a dropdown list to load them in, and also an option to load from file.
The latter should be used if you not copy/paste the obj file in the aforementioned folder.

Also mentioned in the video description
Quote (selected)
With the load from file you can accept custom modelled obj files if you save them in the inkscape/share/extensions/poly3Dobjects folder.

Right next to the other existing obj files.