POV-Ray : Newsgroups : povray.advanced-users : Mesh Question Server Time
27 Dec 2024 06:50:19 EST (-0500)
  Mesh Question (Message 1 to 6 of 6)  
From: Randy
Subject: Mesh Question
Date: 30 Oct 2004 19:35:00
Message: <web.418424f54886aaeb944674e10@news.povray.org>
I would like to know if there is a utility available to export a povray
mesh file(mesh1 or mesh2) to a .obj file


Post a reply to this message

From: ingo
Subject: Re: Mesh Question
Date: 31 Oct 2004 02:38:10
Message: <Xns959357D9C5094seed7@news.povray.org>
in news:web.418424f54886aaeb944674e10@news.povray.org Randy wrote:

>    I would like to know if there is a utility available to export a
> povray mesh file(mesh1 or mesh2) to a .obj file
> 

I once made a simple python script to do that,
you can find it on this newsserver:

Newsgroups: povray.binaries.utilities
Subject: mesh to obj converter
From: ingo <ing### [at] tagpovrayorg>
Message-ID: <Xns94F5A773245Aseed7@news.povray.org>
Date: 25 May 2004 19:01:44 -0400
Xref: news.povray.org povray.binaries.utilities:3739
http://news.povray.org/Xns94F5A773245Aseed7@news.povray.org

Ingo


Post a reply to this message

From: Randy
Subject: Re: Mesh Question
Date: 31 Oct 2004 14:00:00
Message: <web.4185357c35e28514944674e10@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> I once made a simple python script to do that,
> you can find it on this newsserver:
>
> Newsgroups: povray.binaries.utilities
> Subject: mesh to obj converter
> From: ingo <ing### [at] tagpovrayorg>
> Message-ID: <Xns94F5A773245Aseed7@news.povray.org>
> Date: 25 May 2004 19:01:44 -0400
> Xref: news.povray.org povray.binaries.utilities:3739
> http://news.povray.org/Xns94F5A773245Aseed7@news.povray.org
>
> Ingo

Thanks for your responce Ingo
  I assume you are the same person who wrote parim.inc. If so that is a
great macro. But, back to mesh conversion, I have two questions.
    1) I'm not familiar with python scripts, so what do I do with the text
file.
    2) I've actually found I can use microsoft excel to convert mesh files
to object files. When I use parim.inc and write the equation out as a .arr
and then convert this file (I know: redundant since parim.inc already does
this, but I needed mesh files to test) it works as expected. However when I
use meshes from Warps mesh compressor, these files don' work as expected.
I'm not really certain, but could this be because the compressed mesh
doesn't contain the UVnormals.
   I'm not really familiar with object files. I just chose this format
because the data is stored in a simple text format. Is it possible to carry
UVIndices in Object files. Scratching my head alot so any thoughts would be
good

Randy


Post a reply to this message

From: ingo
Subject: Re: Mesh Question
Date: 31 Oct 2004 14:53:31
Message: <Xns9593D484DC370seed7@news.povray.org>
in news:web.4185357c35e28514944674e10@news.povray.org Randy wrote:

> 1) I'm not familiar with python scripts, so what do I do with the
>    text  file.

Before you can do anything with it you'll have to install Python
http://www.python.org 
Then from the directory where the script is you
can do something like this from the command prompt c:\...\> python
mesh22obj.py bigmeshfile.pov 

> 2) [...] However when I use meshes from Warps mesh compressor,
> these  files don' work as expected. I'm not really certain, but could
> this be because the compressed mesh doesn't contain the UVnormals. 

To be honest, I do not understand what you mean with this. Do you mean 
that compressed mesh files generated with param.inc don't work with 
Colefax' macro's. Do you mean that you can't convert the compressed mesh 
files with excel, or with the same excel script that you use to convert 
the .arr files? Or something else?

> I'm not really familiar with object files. I just chose this format 
> because the data is stored in a simple text format.

What is it you're trying to acheive with converting pov-mesh' to .obj or 
other files?

> Is it possible to carry UVIndices in Object files.

Yes.


Ingo


Post a reply to this message

From: Warp
Subject: Re: Mesh Question
Date: 1 Nov 2004 05:26:32
Message: <41860f58@news.povray.org>
Randy <wro### [at] charternet> wrote:
> However when I
> use meshes from Warps mesh compressor, these files don' work as expected.

  Which version of the compressor are you using?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Randy
Subject: Re: Mesh Question
Date: 1 Nov 2004 17:25:00
Message: <web.4186b6ec35e28514944674e10@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:
> To be honest, I do not understand what you mean with this. Do you mean
> that compressed mesh files generated with param.inc don't work with
> Colefax' macro's. Do you mean that you can't convert the compressed mesh
> files with excel, or with the same excel script that you use to convert
> the .arr files? Or something else?
>
> What is it you're trying to acheive with converting pov-mesh' to .obj or
> other files?
>
> Ingo

 I am using version 2.1 of the mesh compressor, but I am not having any
problem using parim.inc in it.
 Here is what I am trying to do: I have made an interesting looking tree
trunk model using isosurface functions., but have had no luck attaching
branches to it that I like. So what I wanted to do was export the mesh to
another program and hand make the branches. So I used the approximation
macro, isosurf_KL_JF.inc, which generated an include file that contained
the mesh. So now all I needed to do was export this mesh in a format that
3DWin could convert, to say a LIghtwave object. Being a creature of habit I
decided to use Microsoft Exel to convert the file. As an expeiment I
converted a arbitrary array file generated from perim.inc. I did this
becuase of the fact that this macro could write object files internally and
I wanted to see if I could reproduce the results. When I imported this file
in 3DWin it converted it to an object for lightwave perfectly, except the
faces were all in the wrong direction. No problem just flip them in
lightwave. The incluce file generated by the approximation macro was a
smooth triangle mesh. I converted the file, in excel, with only vertex and
normal vectors. 3DWin did not convert it to a lightwave object. I thought
this to be do to no face indices. So I then used mesh compressor V2.1 to
convert the smooth mesh to a mesh2 format. I converted this file, in Exel,
but 3DWin could not convert this file either.
 What am I missing. Maybe a macro or program already exists that will
convert isosurface functons to an object (.obj) file much the same way that
isosurf_KL_JF.inc wites a smooth mesh file. Just in case I am being math
stupid here is the function I am trying to export:

#declare Tree = function{ f_polytubes(x,y/2,z, 4, -1, -1/100, 1, .1,
-0.25)*1.2 + f_helix2(x,y,z, 0, 3, 1, 0.4, 0, 0.5, 0)*.6}

isosurface {
    function {Tree(x,y,z)}
    threshold 2
    contained_by {box{<-2,-10,-2><2,10,2>}}
    max_gradient 28.622
    pigment {rgb 1}
    scale <.52,.44,.52>
    translate<0,1,0>
}

 I am sorry for my delay in responce, My server went down yesterday

Randy


Post a reply to this message

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