Mike B. wrote: > Dear Christophe, > > --- On *Mon, 6/29/09, Christophe Geuzaine /<[email protected]>/* wrote: > > > From: Christophe Geuzaine <[email protected]> > Subject: Re: [Gmsh] Reading BoundingBox coordinates > To: "Mike B." <[email protected]> > Cc: "Gmsh mai. lis." <[email protected]> > Date: Monday, June 29, 2009, 2:06 AM > > Mike B. wrote: > > Dear Gmsh users, > > > > Is there a way to read the coordinates found by the BoundingBox > commmand?. This fails (syntax error): > > t[] = BoundingBox; > > > > Hi Mike - Try: > > xmin = General.MinX; > xmax = General.MaxX; > ymin = General.MinY; > ymax = General.MaxY; > zmin = General.MinZ; > zmax = General.MaxZ; > > Thanks for your reply. I define a square and print the variables you've > mentioned: > > Point(1) = {-5000, -5000 ,-5000}; > Point(2) = {-5000, 5000, -5000}; > Point(3) = {5000 ,5000 ,-5000}; > Point(4) = {5000 ,-5000, -5000}; > > Printf( "Min.X %g Min.Y %g Min.Z %g", General.MinX, General.MinY, > General.MinZ ); > Printf( "Max.X %g Max.Y %g Max.Z %g", General.MaxX, General.MaxY, > General.MaxZ ); > > However, this gives in the message window: > Min.X 0 Min.Y 0 Min.Z 0 > Max.X 0 Max.Y 0 Max.Z 0 >
Indeed, I forgot that starting with version 2.0 the bounding box is only computed *after* a file is parsed... I've added a workaround, which should be available in tomorrow's snapshot: you can now add BoundingBox; anywhere in the .geo file to force the re-computation of the bounding box. (It's a bit ugly but it's necessary until we find the time to suppress the 2-step model creation we use in the parser at the moment :-() > Shouldn't it gives the bounding box enclosing the square?. > > Thanks, > Mike. > > -- Prof. Christophe Geuzaine University of Liege, Electrical Engineering and Computer Science http://www.montefiore.ulg.ac.be/~geuzaine _______________________________________________ gmsh mailing list [email protected] http://www.geuz.org/mailman/listinfo/gmsh
