|
 |
On 2-12-2017 17:23, Bald Eagle wrote:
> Thomas de Groot <tho### [at] degroot org> wrote:
>
>> Ah, thanks indeed! I was just starting to work on this - from a
>> different angle I must confess, but to the same ultimate result. THis
>> comes just in time.
>
> Certainly :)
> With so many people with so few Round Tuits, it's a lot easier to pitch in
> 1/4-of-a-Round-Tuit each and get 1 full final result.
Like bitcoins, their value increases worryingly.
>
> I'll see if I can work on this some more - if you have any questions or ideas
> for improvements, let me know.
> One thing that comes to mind is to use trace() to limit scanning the entire
> bounding box, though it seems to go fast enough at the moment.
> Maybe that could be a switchable enable/disable feature for when high-density
> scanning of sparse objects are used.
>
At this point, I have the following code ready (write/read) installed,
based on (the first part of) your own code. I increased the container a
bit to be sure the model was completely inside. Nice to be working again
with arrays. I am not using them as often as I should:
//start code-----------------------
#if (Write)
#debug " writing object locations...\n"
#fopen ObjLocs "ArrayFill.inc" write
#declare MinZ = floor(Min.z-0.1);
#declare MinY = floor(Min.y-0.1);
#declare MinX = floor(Min.x-0.1);
#declare MaxZ = ceil(Max.z+0.1);
#declare MaxY = ceil(Max.y+0.1);
#declare MaxX = ceil(Max.x+0.1);
#declare Step = 0.01;
#declare ZRange = (MaxZ - MinZ)/Step;
#declare YRange = (MaxY - MinY)/Step;
#declare XRange = (MaxX - MinX)/Step;
#declare ArraySize = XRange*YRange*ZRange;
#declare TestArray = array [ArraySize];
#declare N = 0;
#for (Z, MinZ, MaxZ, Step)
#for (Y, MinY, MaxY, Step)
#for (X, MinX, MaxX, Step)
#if(inside (Model, <X, Y, Z>))
#declare TestArray [N] = <X, Y, Z>;
//#debug concat ( "Point ", str (N, 3, 1), " = ", vstr(3,
TestArray[N], ", ", 3, 3), " \n")
#write (ObjLocs,"<",vstr(3, TestArray[N], ", ", 3, 3),">",",\n")
#declare N = N +1;
#end
#end
#end
#end
#fclose ObjLocs
#end //of Write
#debug " reading sand locations...\n"
#fopen ObjLocs "ArrayFill.inc" read
union {
#while (defined(ObjLocs))
#read (ObjLocs, Locs)
sphere {0, 0.01 translate Locs}
#end
rotate 20*y
}
//end code--------------------------------
I have to correct the original model a bit: welding vertices and filling
holes. This has become critical for this method. The example image shows
why (eyes and mouth still with holes).
I have to study the second part of your code now. I do not yet fully
understand it.
--
Thomas
Post a reply to this message
Attachments:
Download 'antony gormley sim.png' (390 KB)
Preview of image 'antony gormley sim.png'

|
 |