POV-Ray : Newsgroups : povray.general : Example of .obj import please Server Time
31 Oct 2024 12:14:49 EDT (-0400)
  Example of .obj import please (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: The Traveler
Subject: Example of .obj import please
Date: 30 Sep 2021 17:05:00
Message: <web.61562502751880cedd31149be3dfee7c@news.povray.org>
Howdy folks,
Would some kind soul please post a short, simple code example for importing an
...obj file into 3.7.1? I'm consistently getting this error: Parse Error: No
triangles in triangle mesh. I don't understand why as the .obj file is properly
formed and is imported without problems by a number of 3D modeling programs. I'm
using the "boilerplate" code example from the wiki with the parameters changed
for my testing:

#declare MyTexture = texture { ... }
#declare MyMaterial = material { ... }

mesh {
  obj "MyMesh.obj"
  texture_list {
    "Foo" texture { MyTexture }
    "Bar" material { MyMaterial }
    prefix "Tx"
    suffix "_"
  }
  inside_vector y
}


Thanks in advance.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 17:29:38
Message: <61562c42$1@news.povray.org>
On 2021-09-30 5:01 PM (-4), The Traveler wrote:
>
> Would some kind soul please post a short, simple code example for importing an
> ...obj file into 3.7.1?

Are you aware that 3.7.1 has been retracted?  Approved versions are
3.7.0.* and 3.8.0-beta.2.


Post a reply to this message

From: The Traveler
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 17:40:00
Message: <web.61562e42cc8d58d2dd31149be3dfee7c@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2021-09-30 5:01 PM (-4), The Traveler wrote:
> >
> > Would some kind soul please post a short, simple code example for importing an
> > ...obj file into 3.7.1?
>
> Are you aware that 3.7.1 has been retracted?  Approved versions are
> 3.7.0.* and 3.8.0-beta.2.

I wasn't. My bad though. I've been experimenting with 3.8.0-b2 but it's giving
me some .ini file parsing problems so I actually have 3.7.0 installed.


Post a reply to this message

From: The Traveler
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 17:45:00
Message: <web.61562f02cc8d58d2dd31149be3dfee7c@news.povray.org>
"Version 3.7.1 extended the mesh object by adding a New feature that supports
importing Wavefront (OBJ) files."

So it appears I'll need to use 3.8.0-b2 as .obj import isn't in 3.7.0 ...


Post a reply to this message

From: The Traveler
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 18:00:00
Message: <web.6156331acc8d58d2dd31149be3dfee7c@news.povray.org>
"The Traveler" <jho### [at] northrimnet> wrote:
> "Version 3.7.1 extended the mesh object by adding a New feature that supports
> importing Wavefront (OBJ) files."
>
> So it appears I'll need to use 3.8.0-b2 as .obj import isn't in 3.7.0 ...

3.8.0-b2 gives the same error.


Post a reply to this message

From: Bald Eagle
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 18:15:00
Message: <web.61563627cc8d58d21f9dae3025979125@news.povray.org>
"The Traveler" <jho### [at] northrimnet> wrote:
> "The Traveler" <jho### [at] northrimnet> wrote:
> > "Version 3.7.1 extended the mesh object by adding a New feature that supports
> > importing Wavefront (OBJ) files."
> >
> > So it appears I'll need to use 3.8.0-b2 as .obj import isn't in 3.7.0 ...
>
> 3.8.0-b2 gives the same error.

IIRC, Cousin Ricky and I both resort to using spreadsheets to convert STL files
to proper POV-Ray mesh {} syntax.

Roland Smith also has a python script on GitHub:

https://github.com/rsmith-nl/stltools


But probably the easiest and most used way to do it is to use PoseRay.
https://sites.google.com/site/poseray/


Post a reply to this message

From: The Traveler
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 18:50:00
Message: <web.61563dcbcc8d58d2dd31149be3dfee7c@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "The Traveler" <jho### [at] northrimnet> wrote:
> > "The Traveler" <jho### [at] northrimnet> wrote:
> > > "Version 3.7.1 extended the mesh object by adding a New feature that supports
> > > importing Wavefront (OBJ) files."
> > >
> > > So it appears I'll need to use 3.8.0-b2 as .obj import isn't in 3.7.0 ...
> >
> > 3.8.0-b2 gives the same error.
>
> IIRC, Cousin Ricky and I both resort to using spreadsheets to convert STL files
> to proper POV-Ray mesh {} syntax.
>
> Roland Smith also has a python script on GitHub:
>
> https://github.com/rsmith-nl/stltools
>
>
> But probably the easiest and most used way to do it is to use PoseRay.
> https://sites.google.com/site/poseray/

Thanks guys. Poseray is not an option as I'm on Linux and would prefer not to
load WINE to run it. I've been eyeballing the .stl format which is the native
output 3d format for the program I'm using (Mandelbulber) so I may end up coding
a stl2mesh2 converter in C with the Qt toolkit eventually.

MeshLab runs under Linux and converts .stl very nicely to .obj and I was hoping
it worked in 3.8.0-b2 but apparently no dice ...

Thanks for the heads up on the the Roland Smith script. I'll may give it a go. I
know Python so if I hit a snag I can probably fix it or port it to pyQt for
a nice GUI interface.

Cheers.


Post a reply to this message

From: The Traveler
Subject: Re: Example of .obj import please
Date: 30 Sep 2021 20:00:00
Message: <web.61564edbcc8d58d2dd31149be3dfee7c@news.povray.org>
One note, the Roland Smith script does work fairly well so there's a solution
for the time being. The files are fairly large and parsing the .inc file that
the script produces takes some time.

I may have to resort to Blender as it has no issues with importing the original
..stl file and has provision to use Povray for it's renderer.

Ah, light at the end of the tunnel perhaps. Listen, is that a train ... ?

Cheers.


Post a reply to this message

From: Alain Martel
Subject: Re: Example of .obj import please
Date: 1 Oct 2021 11:13:08
Message: <61572584$1@news.povray.org>

> Howdy folks,
> Would some kind soul please post a short, simple code example for importing an
> ...obj file into 3.7.1? I'm consistently getting this error: Parse Error: No
> triangles in triangle mesh. I don't understand why as the .obj file is properly
> formed and is imported without problems by a number of 3D modeling programs. I'm
> using the "boilerplate" code example from the wiki with the parameters changed
> for my testing:
> 

.OBJ often don't contain triangles but polys. Most are composed of a 
collection of quadrangles.
That mean that they need to be loaded as unions of bicubic patches.


Post a reply to this message

From: The Traveler
Subject: Re: Example of .obj import please
Date: 1 Oct 2021 16:25:00
Message: <web.61576dc0cc8d58d2dd31149be3dfee7c@news.povray.org>
Alain Martel <kua### [at] videotronca> wrote:
>
> > Howdy folks,
> > Would some kind soul please post a short, simple code example for importing an
> > ...obj file into 3.7.1? I'm consistently getting this error: Parse Error: No
> > triangles in triangle mesh. I don't understand why as the .obj file is properly
> > formed and is imported without problems by a number of 3D modeling programs. I'm
> > using the "boilerplate" code example from the wiki with the parameters changed
> > for my testing:
> >
>
> .OBJ often don't contain triangles but polys. Most are composed of a
> collection of quadrangles.
> That mean that they need to be loaded as unions of bicubic patches.

Generally I tessellate the mesh beforehand and insure its well formed. No
surprises that way ... Cheers.


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.