POV-Ray : Newsgroups : povray.unofficial.patches : SuperPatch / triangle mesh : SuperPatch / triangle mesh Server Time
2 Nov 2024 15:26:03 EDT (-0400)
  SuperPatch / triangle mesh  
From: edna dornblazer
Date: 30 Jun 1999 19:42:03
Message: <377AAB06.3A55@geocities.com>
in SuperPatch version of parse.c, in the function
Parse_Mesh(), there is the line
	number_of_vertices=0;

then in parsing of 'plain' (non-smooth) triangles,
nothing is done to number_of_vertices. 
Looking down at the smooth_triangle mesh code,
number_of_vertices is set for smooth_triangles 
by calling
	Mesh_Hash_Vertex(&number_of_vertices, 
			&max_vertices, 
			&Vertices, P1);
but Mesh_Hash_Vertex(&number_of_vertices,...) is
not called for plain triangles.

But then later there is:
	Object->Data->Vertices =
          (SNGL_VECT
*)POV_MALLOC(number_of_vertices*sizeof(SNGL_VECT), 	    "triangle mesh
data");

and POV-Ray stops for trying to malloc zero bytes.

Now, what I did, and it is working, is just stick in some
	Mesh_Hash_Vertex(&number_of_vertices, 
			&max_vertices, 
			&Vertices, P1);
for plain triangles.

Comments / condemnations ??


Post a reply to this message

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