POV-Ray : Newsgroups : povray.bugreports : makemesh problem : makemesh problem Server Time
11 Oct 2024 16:29:53 EDT (-0400)
  makemesh problem  
From: kurtz le pirate
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

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