Scaling of RV Tangaroa?

27 views
Skip to first unread message

Stefan Bošković

unread,
Nov 12, 2021, 12:48:43 PM11/12/21
to basil...@googlegroups.com
Hello,

I was doing src/examples/tangaroa.c and I read that the length of the
ship is unity, so I tried scaling it, but without success. I added in
fraction_from_stl (in different places) something like:
p->x *= 3.;
min.x *= 3.;
max.x *= 3.;
foreach()
d[] *= 3.;
phi[] = 3.*(d[] + d[-1] +...
I was trying to make it, for example, three times wider (without
changing its length and height) or just three times larger (without
changing the size of the geometry cube).
Can this somehow be done without changing the .stl file?

Regards,
Stefan Bošković

Stephane Popinet

unread,
Nov 12, 2021, 1:00:02 PM11/12/21
to basil...@googlegroups.com
Hi Stefan,

You just need to apply coordinate transformations to the list of
coordinates returned by input_stl() i.e. something like:

coord * p = input_stl (fp);
for (coord * i = p; i->x != nodata; i++)
i->x *= 3.;

cheers,

Stephane

Stefan Bošković

unread,
Nov 12, 2021, 1:08:35 PM11/12/21
to Stephane Popinet, basil...@googlegroups.com
Hi Stephane,

Thank you very much. It works.

Best regards,
Stefan Bošković
Reply all
Reply to author
Forward
0 new messages