SEE THIS POST IN ENGLISH
Witam ponownie.
Od ostatniego wpisu minęło trochę czasu, ale jestem ponownie on-line.
Dzisiaj mały podgląd jak działa to, co do tej pory udało się napisać.
Bez dźwięku – nie podoba mi sie mój głos :D
Pierwsze wideo to tylko Sketchup.
Mamy dwie krzywe definiujące narysowane przy pomocy pluginu BezierCurves.
Obie krzywe maja taką samą dokładność (50 odcinków).
Trzecia krzywa, zamknięta to nasza definicja kamuflażu..
Pierwszym krokiem jest rozpięcie powierzchni na krzywych definiujących. Wykorzystamy do tego kolejny plugin - skin.
Ustawienia, jakich używam można zobaczyć na filmie.
Następnie wyciągamy naszą definicję kamuflażu aż przeniknie całkowicie wcześniej utworzoną powierzchnie.
Wykonujemy przecięcie elementów i usuwamy niepotrzebne już części. Na naszej powierzchni mamy zrzutowane linie kamuflażu.
Kolejnym krokiem jest wyeksportowanie punktów. Czynność tą wykonujemy 3 razy, dla 2 krzywych definiujących oraz dla punktów na powierzchni.
Drugie wideo to pierwsza część obliczeń w Excelu.
Importujemy punkty krzywych. W drugim arkuszu Excela mamy podgląd krzywych z ponumerowanymi punktami. Zasada, która została przyjęta do obliczeń mówi, że krzywa powinna przebiegać przeciwnie do ruchu wskazówek zegara. Nasze krzywe powinny zaczynać się w dolnej części, więc punkty nr 51 powinny być punktami nr 1 a punkty 50 punktami nr 2 . Na podglądzie widać również, że w górnej części krzywej nr 2 ( niebieskiej ) występuje małe zamieszanie przy punktach 1,2 i 3 ( kolejność punktów).
Wracamy do pierwszej zakładki i wpisujemy przy punktach 50 i 51 odpowiednio 1 i 2 ( Patrz pierwsza kolumna, nie numer wiersza!) Sortujemy punkty pierwszej krzywej i patrzymy na podgląd 3D. Sortujemy drugą krzywą i sprawdzamy czy krzywe mają odpowiedni układ.
Nasza powierzchnia jest już rozwinięta.
Przechodzimy teraz do trzeciego arkusza, aby rozwinąć również linie kamuflażu.
(Ignorujemy komunikat o błędzie – pojawia się, ponieważ nie ma dostępnych żadnych danych..)
Importujemy punkty I uruchamiamy makro, które rozwinie punkty na powierzchni.
Rozwinięcie 300 punktów na powierzchni zdefiniowanej przy pomocy 2x 50 odcinków zajęło niecałą minutę. Czas ten jest oczywiście zależny od ilości punktów i definicji krzywych.
Po zakończonych obliczeniach eksportujemy rozwinięte punkty do pliku CSV ( wartości rozdzielone przecinkami).
Co można zrobić z tym plikiem, pokażę w kolejnej odsłonie.
Showing posts with label Excel. Show all posts
Showing posts with label Excel. Show all posts
Sunday, May 22, 2011
Video !!! How it works so far.
SEE THIS POST IN POLISH
Welcome again.
It has been a while, but I am back online.
So today a small preview of how it works so far.No voice over - My voice just sounds strange :D
First video is pure Sketchup.
We have 2 definition curves created with Bezier curves.
Note that precision of both curves is set to the same value (50 parts).
There is also another closed curve that will be used as a definition of camouflage.
First we create our surface with another ruby script - skin.
You can see what settings I used.
Then we pull our camouflage definition, and create intersection with our surface.
When cleared from all not necessary parts we can see camo lines on our surface.
Next part is to export points to a files, one for top curve, one for bottom curve and one for all camo points.
Second video is first part of excel calculations.
First we import points for definition curves. On a preview you can see that points are numbered and this will be used for sorting. Calculations are made in a way that curves should go anticlockwise. So our starting point is at bottom, and first point should be where nor point 51 is.Next point would be where now 50's are. Also You can see at the top that on curve 2 ( blue ), there is something wrong ( look at the points 2,1 and 3)
So we go back to curves input , and set points nr 51 on both curves as 1 and points 50 as 2 , after resorting points on first curve You can seethe effect ( best on 3d preview).
Resorting second curve gets us our developer surface.
We can import camouflage line points.
(Error message occurs because there is no points data available.)
We run a macro to develop points onto surface , and after some time we get all points developed.
Time it takes is dependent on number of points to develop and number of points on definition curves.
When all calculations are done we can export all points to CSV file to get it to Sketchup again.
Third part next time.
Welcome again.
It has been a while, but I am back online.
So today a small preview of how it works so far.No voice over - My voice just sounds strange :D
First video is pure Sketchup.
We have 2 definition curves created with Bezier curves.
Note that precision of both curves is set to the same value (50 parts).
There is also another closed curve that will be used as a definition of camouflage.
First we create our surface with another ruby script - skin.
You can see what settings I used.
Then we pull our camouflage definition, and create intersection with our surface.
When cleared from all not necessary parts we can see camo lines on our surface.
Next part is to export points to a files, one for top curve, one for bottom curve and one for all camo points.
Second video is first part of excel calculations.
First we import points for definition curves. On a preview you can see that points are numbered and this will be used for sorting. Calculations are made in a way that curves should go anticlockwise. So our starting point is at bottom, and first point should be where nor point 51 is.Next point would be where now 50's are. Also You can see at the top that on curve 2 ( blue ), there is something wrong ( look at the points 2,1 and 3)
So we go back to curves input , and set points nr 51 on both curves as 1 and points 50 as 2 , after resorting points on first curve You can seethe effect ( best on 3d preview).
Resorting second curve gets us our developer surface.
We can import camouflage line points.
(Error message occurs because there is no points data available.)
We run a macro to develop points onto surface , and after some time we get all points developed.
Time it takes is dependent on number of points to develop and number of points on definition curves.
When all calculations are done we can export all points to CSV file to get it to Sketchup again.
Third part next time.
Friday, April 15, 2011
Progress with work
SEE THIS POST IN POLISH
Sheet 1 - Development Preview, Definition curves in head view and in axonometry.

Not so much time to write here, but it is steady going forward.
Sheet 1 - Definition curves data.
Sheet 1 - Development Preview, Definition curves in head view and in axonometry.
Sheet 2 - More detailed head-on view of definition curves . This will be used to properly orientate our part .
Sheet 3 - Input data for points on the surface .
Sheet 3 - Preview of surface points in axonometry .
Sheet 3 - Preview of developed surface points .
In fact it s possible to export this data to Sketchup and draw an developed element . But at this moment there is no Sketchup plugin to automatically fit curve to set of points , so You would have to draw an curve point by point.
At this moment work is concentrated on work arount for this .
To be continued . . .
To be continued . . .
Postęp w pracy
SEE THIS POST IN ENGLISH
Zakładka 1 - Podgląd rozwinięcia, podgląd krzywych definiujących w rzucie i w aksonometrii.

Brak czasu na blogowanie , ale praca przy arkuszu idzie powoli do przodu.
Zakładka 1 - dane krzywych definiujących.
Zakładka 1 - Podgląd rozwinięcia, podgląd krzywych definiujących w rzucie i w aksonometrii.
Zakładka 2 - Dokładny podgląd krzywych . Będzie wykorzystywany przy odpowiednim ustwieniu orientacji elementu .
Zakładka 3 - Dane wejściowe punktów na powierzchni i ich rozwinięcie .
Zakładka 3 - Podgląd punktów na powierzchni w aksonometrii .
Zakładka 3 - Podgląd punktów na powierzchni w rozwinięciu.
Teoretycznie współrzędne tych punktów można juz wyeksportować do Sketchupa. i na ich podstawie wykreślić element wraz z liniami podziału . W tym momencie nie ma jeszcze pluginu do Sketchup'a, który automatycznie dopasuje krzywą do zbioru punktów, więc trzeba by to zrobić punkt po punkcie.
Więc aktualnie prace przy arkuszu sprowadzają się do obejścia tego problemu.
Friday, April 1, 2011
Automatyka excela
Zastosujmy teraz to co do tej pory wiemy , w praktyce:
Odległości między punktami |
r1 , r2 , r3 oraz r4 dla pierwszej pary punktów |
| > |
| r1 , r2 , r3 oraz r4 dla drugiej pary punktów |
Rozwinięta powierzchnia z przykładu 1 |
Formuły |
Obok podstawowy arkusz.
Pokazane na nim wszystkie formuły , a poniżej ich wytłumaczenie .
Wypełnione są tylko pierwsze wiersze , pozostałe można skopiować.
Komórka A3 : Numer punktu
Komórki B3-D3 : Współrzędne punktów na krzywej A
Komórki E3-G3: Współrzędne punktów na krzywej B
Komórka H3 : Odległość między A1 i A2 [r1]
Komórka I3 : Odległość między A2 i B1 [r2]
Komórka J3 : Odległość między A1 i B1 [D]
Komórka K3 : Różnica pomiędzy współrzędnymi x punktów A'1 i B'1 [Dx]
Komórka L3 : Różnica pomiędzy współrzędnymi y punktów A'1 i B'1 [Dy]
Komórka M3 : Wartość a wyliczona przy pomocy r1, r2 i D [a]
Komórka N3 : Wartość h wyliczona przy pomocy r1 i a [h]
Komórka O3 : Odległość między A2 i B2 [r3]
Komórka P3 : Odległość między B1 i B2 [r4]
Komórka Q3 : Odległość między A2 i B1 [D]
Komórka R3 : Różnica pomiędzy współrzędnymi x punktów A'2 i B'1 [Dx]
Komórka S3 : Różnica pomiędzy współrzędnymi y punktów A'2 i B'1 [Dy]
Komórka T3 : Wartość a wyliczona przy pomocy r3, r4 and D [a]
Komórka U3 : Wartość h wyliczona przy pomocy r3 i a [h]
Komórki V3-X3 : Punkt początkowy rozwiniętej powierzchni (x, y, z) [point A'1]
Komórki Y3-AA3 : Punkt B'1 , współrzędna x = współrzędna x punktu A'1 plus wartość D z komórki J3
Współrzędne y i z są takie same jak punktu A'1
Komórki V4-X4 : Współrzędne x i y punktu A'2 , wyliczone przy pomocy r1 , r2 , h , a , Dx , Dy i D.
Współrzędna z taka sama jak punktu A'1
Komórki Y4-AA4 : Współrzędne x i y punktu B'2 , wyliczone przy pomocy r3 , r4 , h , a , Dx , Dy i D.
Nasz pierwszy przykład obliczony przy pomocy arkusza .
Komórki Y4-AA4 : Współrzędne x i y punktu B'2 , wyliczone przy pomocy r3 , r4 , h , a , Dx , Dy i D.
Współrzędna z taka sama jak punktu B'1
| Obliczony przykład 1 |
Arkusz można oczywiście wzbogacić o inne funkcje , np podgląd rozwiniętej powierzchni .
| Przykład 2 . Krzywe, Punkty, trójkąty, Powierzchnia i jej rozwinięcie |
Współrzędne punktów zostały zaimportowane do naszego arkusza, a następnie na podstawie przeliczonych współrzędnych narysowano rozwinięcie.
C.D.N.
Excel automation
Lets put what we already know into practice :
| Example 1 |
| Distances between points |
| r1 , r2 , r3 and r4 for first pair of points |
| r1 , r2 , r3 and r4 for second pair of points |
For a second pair we do the same and we can see all the marked lines on a picture .
| Developed surface from example 1 |
This is a simple version of such a spreadsheet .
You can see the formulas , and below i will give explanation of all of them .
Only first line is inputted, rest of the formulas will be automatically inputted using fill handle .
Cell A3 : Point number
Cells B3-D3 : Coordinates of points in curve A
Cells E3-G3: Coordinates of points in curve A
Cell H3 : Distance between point A1 and A2 [r1]
Cell I3 : Distance between point A2 and B1 [r2]
Cell J3 : Distance between point A1 and B1 [D]
Cell K3 : Difference between x coordinates of points A'1 and B'1 [Dx]
Cell L3 : Difference between y coordinates of points A'1 and B'1 [Dy]
Cell M3 : Value of a based on r1, r2 and D [a]
Cell N3 : Value of h based on r1and a [h]
Cell O3 : Distance between point A2 and B2 [r3]
Cell P3 : Distance between point B1 and B2 [r4]
Cell Q3 : Distance between point A2 and B1 [D]
Cell R3 : Difference between x coordinates of points A'2 and B'1 [Dx]
Cell S3 : Difference between y coordinates of points A'2 and B'1 [Dy]
Cell T3 : Value of a based on r3, r4 and D [a]
Cell U3 : Value of h based on r3and a [h]
Cells V3-X3 : Starting point of developed surface (coordinates x, y, z) [point A'1]
Cells Y3-AA3 : point B'1 , coordinate x = coordinate x of point A'1 plus value D from cell J3
Coordinates y and z are the same as of point A'1
Cells V4-X4 : Coordinates x and y of point A'2 , based on r1 , r2 , h , a , Dx , Dy and D.
Coordinate z is the same as z of point A'1
Cells Y4-AA4 : Coordinates x and y of point B'2 , based on r3 , r4 , h , a , Dx , Dy and D.
Our example calculated with a spreadsheet .
Cells Y4-AA4 : Coordinates x and y of point B'2 , based on r3 , r4 , h , a , Dx , Dy and D.
Coordinate z is the same as z of point B'1
| Calculated example 1 |
We can of course expand our spreadsheet for more points, and add for example an preview of developed surface .
| Example 2 . Curves, points, triangles, surface and developed surface |
Coordinates of the points were exported to excel file , and then inputted into our spreadsheet .
Then calculated developed point were exported and on base of those was developed surface drawn .
To be continued ...
Subscribe to:
Posts (Atom)