POV-Ray : Newsgroups : povray.bugreports : makemesh problem Server Time
24 Nov 2024 05:11:27 EST (-0500)
  makemesh problem (Message 1 to 5 of 5)  
From: kurtz le pirate
Subject: makemesh problem
Date: 1 Jul 2024 06:12:42
Message: <6682811a@news.povray.org>
Hi,


"makemesh.inc" by Ingo Janssen in 2002 is a superb and very useful macro.


But I found a small issue. For "small" resolutions, it's okay.
At higher resolutions, however, the bug appears.


Let's say the resolution is 1000.
So we have Iter_U = 1000 and Iter_V = 1000

When using the generated file created by "makemesh.inc"
i get this error :

"10_sphere_mesh.txt"
line 200404
Parse Error: No matching }, < found instead




By studying what the file (122Mo) contains i can see :

#declare Surface = mesh2 {
  vertex_vectors {
    1.002e+06
	...
  normal_vectors {
    1.002e+06
	...
  uv_vectors {
    1.002e+06
	...
  face_indices {
    2e+06
	...

As you can see, the number of elements in each section is in scientific
notation.

But, 1.002e+06 is interpreted as 1 002 000 while the real number is 1
002 001.

Of course the POVRay finds vector's elements before the end of section.


The lines in question look like this :
#write(
	FILE_HANDLE,
	"  vertex_vectors {\n",
	"    ", NumVertices,"\n    "
	)

Just change :
	"    ", NumVertices,"\n    "
By :
	"    ", str(NumVertices,0,0),"\n    "

And it works like a charm!


The official distribution of this macro should be corrected, but I don't
know where it is.
Ingo Janssen doesn't seem to have a site anymore.



Hope that help ;)

-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: Bald Eagle
Subject: Re: makemesh problem
Date: 1 Jul 2024 07:05:00
Message: <web.66828d27cf5155ee1f9dae3025979125@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> Just change :
>  "    ", NumVertices,"\n    "
> By :
>  "    ", str(NumVertices,0,0),"\n    "
>
> And it works like a charm!


Nice catch, and excellent debugging!


> The official distribution of this macro should be corrected, but I don't
> know where it is.
> Ingo Janssen doesn't seem to have a site anymore.

https://ingoogni.nl/

- BW


Post a reply to this message

From: ingo
Subject: Re: makemesh problem
Date: 1 Jul 2024 09:00:00
Message: <web.6682a76acf5155ee17bac71e8ffb8ce3@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:


Thanks, I'll have a look and report back when fixed with proper link etc.

ingo

>
> The official distribution of this macro should be corrected, but I don't
> know where it is.
> Ingo Janssen doesn't seem to have a site anymore.
>


Post a reply to this message

From: ingo
Subject: Re: makemesh problem
Date: 1 Jul 2024 10:50:00
Message: <web.6682c207cf5155ee17bac71e8ffb8ce3@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:


Bonjour Kurtz

What version, are you using? The one on my site seems to run fine and searching
for ' NumVertices,"\n ' yields no result. The same for the files in the POV-Ray
distributions. Could you test with the include file from :

https://ingoogni.nl/download/MMM.zip

ingo



>
> "makemesh.inc" by Ingo Janssen in 2002 is a superb and very useful macro.


Post a reply to this message

From: kurtz le pirate
Subject: Re: makemesh problem
Date: 1 Jul 2024 13:37:15
Message: <6682e94b$1@news.povray.org>
On 01/07/2024 16:49, ingo wrote:
> kurtz le pirate <kur### [at] gmailcom> wrote:
> 
> 
> Bonjour Kurtz
> 
> What version, are you using? The one on my site seems to run fine and searching
> for ' NumVertices,"\n ' yields no result. The same for the files in the POV-Ray
> distributions. Could you test with the include file from :
> 
> https://ingoogni.nl/download/MMM.zip
> 

Bonjour Ingo,

The version i use :

// Persistence of Vision Ray Tracer Include File
// File: makemesh.inc
// Vers: 3.5
// Desc: Macros and functions used in builing mesh2 objects.
// Date: 2002/04/27
// Auth: Ingo Janssen


The test with makemesh in "MMM.zip"

// Persistence of Vision Ray Tracer Include File
// File: makemesh.inc
// Vers: 3.5
// Desc: Macros and functions used in builing mesh2 objects.
// Date: 2002/04/27
// Auth: Ingo Janssen

// Rev 2002/10/23 : Added the CheckFileName macro.
//                  Added the option to write Wavefront *.obj files.
//                  Added the option to write *.pcm files, for Chris
Colefax' Compressed Mesh Macros.
//                  Added the option to write *.arr files, this writes
only the arrays to a file.
// Rev 2004/26/5 :  Changed the order the vertices are written in to
counter clockwise

And your site say : "Last update: 2019-01-04" for makemesh.


... I use the original version of April 27, **2002**
I'm "really" not up to date !


Thanks for your answer, all is ok.




-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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