Flat surface


Flat surface
#1
Hi,

had a discussion about flat surface on a old minifig head part. Philippe stated he is using his eyes to spot un non-flat surface.
This hunting me in my dreams tonight. Because I'm lazy or just have bad eyes - I tried to come up with some coding magic to improve my eyes.

So my idee was to go through a given file an calculate normlized cross product of each plane and print those value

rename CheckFlat.txt to CheckFlat.java
compile a java binary with "javac CheckFlat.java"
run "java CheckFlat ../Downloads/3626p05s01.dat"

it is possible to tweak precision
java CheckFlat ../Downloads/3626p05s01.dat X Y Z
X: output precision (default is 5)
Y: internal precsision for dividing and square root (default is 150)
Z: rounding (default is 5)
possible values are:
ROUND_CEILING 2
ROUND_DOWN 1
ROUND_FLOOR 3
ROUND_HALF_DOWN 5
ROUND_HALF_EVEN 6
ROUND_HALF_UP 4
ROUND_UNNECESSARY 7
ROUND_UP 0

programm is not very error prove since it was written this morning as a prototyp. So e.g. a very complex file will properly result into an error. Also some rounding values may cause an error too.

It also only check one of the two possible triangle of an quad. All other lines are just printed. You will get something like this:



0 ~Minifig Head with Standard Grin and Eyebrows Pattern - Half Face
0 Name: s\3626p05s01.dat
0 Author: Chris Dee [cwdee]
0 !LDRAW_ORG Unofficial_Subpart
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 BFC CERTIFY CCW

0 !HISTORY 2014-02-13 [smr] BFC, t-junctions, moved half face from 3626bp05 to s\3626p05s01.dat

0.55561 0.00000 -0.83144
0.55588 0.00013 -0.83126
0.55520 0.00002 -0.83172
0.55501 0.00000 -0.83185
0.55507 0.00000 -0.83180

0.19476 -0.00040 -0.98085
0.19519 -0.00001 -0.98076
0.19548 0.00000 -0.98071
0.19525 0.00010 -0.98075
0.19517 0.00000 -0.98077
0.19594 -0.00025 -0.98062
0.19478 -0.00029 -0.98085
0.19548 0.00000 -0.98071
1 16 3.5 10 -12.304 -1.25 0.2486 0 0 0 -1.25 -0.2486 1 0 4-4ndis.dat
0.19779 0.00000 -0.98024
0.19779 0.00000 -0.98024
0.19504 0.00001 -0.98080
0.19545 0.00022 -0.98071
0.19506 0.00015 -0.98079
0.19504 0.00000 -0.98080
0.19504 0.00000 -0.98080
0.19506 0.00000 -0.98079

0.19548 0.00000 -0.98071
0.19484 0.00000 -0.98084
0.19474 -0.00074 -0.98085
1 0 3.5 10 -12.304 -1.25 0.2486 0 0 0 -1.25 -0.2486 1 0 4-4disc.dat
0.19504 0.00000 -0.98080
0.19487 -0.00041 -0.98083
0.19423 0.00000 -0.98096

5 24 4.975 4 -12.01 4.975 17 -12.01 0 4 -13 9.192 4 -9.192
5 24 9.1923 4 -9.1923 9.1923 17 -9.1923 4.9751 4 -12.0107 12.0107 4 -4.9751


Attached Files
.txt   CheckFlat.txt (Size: 4.89 KB / Downloads: 0)
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 2 Guest(s)