y working on is a tensegrity structure that uses cables and a tensile fabric to apply traction. The basic cell of the structure is a sail with two parallel rods.
The easy one was the fabric anchored to the extremes of the rod. I got great results with the tensegrity model , very similar to physical models that I was working on.
But then I tried the same thing with the fabric anchored all along the rods, but it proved to be hard (read all the "rod discussion"). I tried the bending force, but was too unstable. The best model I got was by applying different stiffness to the mesh, specifically, to the lines that coincide with the anchors.
It's by no means the solution that I had in mind, but the next days I'll be testing it with the structure. I came across with the next thing to my ideal solution, Daniel's boat (https://vimeo.com/30128894), but I couldn't replicate it. Anyone has some idea of a different, more rigid solution? Even in K2, which I really don't understand yet, but any clue would be helpful.
Aside of that, I was also having trouble applying real values of stiffness. The third archive has the same definition that the first, but with real stiff values (the rods are wood, k=10^7 N/m, cables are nylon k=2x10^5 N/m). I adjusted the timestep and the subiterations, but it doesn't work as stable and smooth as the whatever-stiffness-sail. I don't know if isn't correctly calibrated, or my computer its too old (it pretty old and slow) or simply isn't a good definition.
If anyone has any idea it would be very much appreciated!
Antonio…
cribes a set of machine movements in X, Y and Z (Z being Pen Up and Pen Down) directions. It very closely related to G-code in this way - just slightly more simple than G-code overall.
For tool selection you use the Select Pen - SPx - command, x is the number of the pen you are using. As I'm using a vinyl cutter without a pen/tool changer I just use SP1 in the file header/ini of the cutter.
Without knowing the full spec of your machine it is hard to say for certain BUT all of my experience with CNC machines - of all sizes and spec levels - the actual control files are pretty much the same. Very simple text based HPGL or G-code text files run all motion control - even on things like 7 axis robot arms etc. For plotting I'd expect you'd be able to get a usable HPGL/PLT file without a lot of work - its just a matter of matching the file to what the machine is expecting.
To answer your question about getting the file to the printer its maybe best to explain it this way: there are two parts to this project1/ Create the correctly formatted text/hpgl/plt file ready to send to the printer2/ Send the file to printer
For part 1/ the procedure is:
Select the curves you want to printConvert the curves into a set of pointsFormat these points into HPGL Save this HPGL as a text file
For 2/ we need a way to stream the text file to a printer port
To do this I've used an old dos command line technique that allows allow you to 'copy' a text file to a printer LPT or COM port:
copy /b c:\spool\ini.plt LPT1
Type the above into a DOS command line and it will send a text file called ini.plt to the printer on LPT1 port. As you'll see in my attached code I use os.system calls in my python code to send files when needed.
So your original code was doing some strange things with the conversion from curves to points. Lines/Polylines were OK - with the code just using the line end points. For curves and polycurves the code code was exploding these into segments and then dividing into set of points. However this led to two issues: - curves that started off as closed polycurves would end up being plotted as open curve segments - which is not very good for a cut file and not very smooth for a plot file.- the division of the curves to points was by distance - and if this wasn't an exact division of the length of the curve the end point would not match up with the next line - again not ideal for a cutting file which needs to be a closed curve.
To solve the above I changed to using rs.ConvertCurveToPolyline - with the tolerance set to match the HPGL resolution of 0.025mm - this converts all curves needed to plot to polylines, leaves everything closed and ends points line up perfectly.
I had one other problem with my setup - I ran into a file size/curve number/plotting points upper limit. A small number of curves would cut/plot fine, however at a certain number in one file the print driver would throw an error and the plotter would not even start plotting the file. I could not work out where is the system this limit was being imposed. The current working version of my code is attached - it gets around this file size limit by creating a separate print file for each curve required and sending them to the plotter in sequence. Not as completely tidy as I'd like as it flashes up a cmd window on every loop - but plots/cuts are perfect.
The final 'nice touch' for the project is I've created a custom tool bar button to run the script - all I have to do to cut a file is hit the button on the tool bar, select the curves and hit enter = SO EASY!
I've attached my latest code, a sample HPGL file to plot a rectangle, and a screen shot of setting up the custom toolbar button.
Cheers
DK…
t file** - ply file with just x,y,z locations. I got it from a 3d scanner. Here is how first few lines of file looks like - ply format ascii 1.0 comment VCGLIB generated element vertex 6183 property float x property float y property float z end_header -32.3271 -43.9859 11.5124 -32.0631 -43.983 11.4945 12.9266 -44.4913 28.2031 13.1701 -44.4918 28.2568 13.4138 -44.4892 28.2531 13.6581 -44.4834 28.1941 13.9012 -44.4851 28.2684 ... ... ... In case you need the data - please email me on **nisha.m234@gmail.com**. **Algorithm:** I am trying to find principal curvatures for extracting the ridges and valleys. The steps I am following is: 1. Take a point x 2. Find its k nearest neighbors. I used k from 3 to 20. 3. average the k nearest neighbors => gives (_x, _y, _z) 4. compute covariance matrix 5. Now I take eigen values and eigen vectors of this covariance matrix 6. I get u, v and n here from eigen vectors. u is a vector corresponding to largest eigen value v corresponding to 2nd largest n is 3rd smallest vector corresponding to smallest eigen value 7. Then for transforming the point(x,y,z) I compute matrix T T = [ui ] [u ] [x - _x] [vi ] = [v ] x [y - _y] [ni ] [n ] [z - _z] 8. for each i of the k nearest neighbors:<br> [ n1 ] [u1*u1 u1*v1 v1*v1] [ a ]<br> [ n2 ] = [u2*u2 u2*v2 v2*v2] [ b ] <br> [... ] [ ... ... ... ] [ c ] <br> [ nk ] [uk*uk uk*vk vk*vk]<br> Solve this for a, b and c with least squares 9. this equations will give me a,b,c 10. now I compute eigen values of matrix [a b b a ] 11. This will give me 2 eigen values. one is Kmin and another Kmax. **My Problem:** The output is no where close to finding the correct Ridges and Valleys. I am totally Stuck and frustrated. I am not sure where exactly I am getting it wrong. I think the normal's are not computed correctly. But I am not sure. I am very new to graphics programming and so this maths, normals, shaders go way above my head. Any help will be appreciated. **PLEASE PLEASE HELP!!** **Resources:** I am using Visual Studio 2010 + Eigen Library + ANN Library. **Other Options used** I tried using MeshLab. I used ball pivoting triangles remeshing in MeshLab and then applied the polkadot3d shader. If correctly identifies the ridges and valleys. But I am not able to code it. **My Function:** //the function outputs to ply file void getEigen() { int nPts; // actual number of data points ANNpointArray dataPts; // data points ANNpoint queryPt; // query point ANNidxArray nnIdx;// near neighbor indices ANNdistArray dists; // near neighbor distances ANNkd_tree* kdTree; // search structure //for k = 25 and esp = 2, seems to got few ridges queryPt = annAllocPt(dim); // allocate query point dataPts = annAllocPts(maxPts, dim); // allocate data points nnIdx = new ANNidx[k]; // allocate near neigh indices dists = new ANNdist[k]; // allocate near neighbor dists nPts = 0; // read data points ifstream dataStream; dataStream.open(inputFile, ios::in);// open data file dataIn = &dataStream; ifstream queryStream; queryStream.open("input/query.
pts", ios::in);// open data file queryIn = &queryStream; while (nPts < maxPts && readPt(*dataIn, dataPts[nPts])) nPts++; kdTree = new ANNkd_tree( // build search structure dataPts, // the data points nPts, // number of points dim); // dimension of space while (readPt(*queryIn, queryPt)) // read query points { kdTree->annkSearch( // search queryPt, // query point k, // number of near neighbors nnIdx, // nearest neighbors (returned) dists, // distance (returned) eps); // error bound double x = queryPt[0]; double y = queryPt[1]; double z = queryPt[2]; double _x = 0.0; double _y = 0.0; double _z = 0.0; #pragma region Compute covariance matrix for (int i = 0; i < k; i++) { _x += dataPts[nnIdx[i]][0]; _y += dataPts[nnIdx[i]][1]; _z += dataPts[nnIdx[i]][2]; } _x = _x/k; _y = _y/k; _z = _z/k; double A[3][3] = {0,0,0,0,0,0,0,0,0}; for (int i = 0; i < k; i++) { double X = dataPts[nnIdx[i]][0]; double Y = dataPts[nnIdx[i]][1]; double Z = dataPts[nnIdx[i]][2]; A[0][0] += (X-_x) * (X-_x); A[0][1] += (X-_x) * (Y-_y); A[0][2] += (X-_x) * (Z-_z); A[1][0] += (Y-_y) * (X-_x); A[1][1] += (Y-_y) * (Y-_y); A[1][2] += (Y-_y) * (Z-_z); A[2][0] += (Z-_z) * (X-_x); A[2][1] += (Z-_z) * (Y-_y); A[2][2] += (Z-_z) * (Z-_z); } MatrixXd C(3,3); C <<A[0][0]/k, A[0][1]/k, A[0][2]/k, A[1][0]/k, A[1][1]/k, A[1][2]/k, A[2][0]/k, A[2][1]/k, A[2][2]/k; #pragma endregion EigenSolver<MatrixXd> es(C); MatrixXd Eval = es.eigenvalues().real().asDiagonal(); MatrixXd Evec = es.eigenvectors().real(); MatrixXd u,v,n; double a = Eval.row(0).col(0).value(); double b = Eval.row(1).col(1).value(); double c = Eval.row(2).col(2).value(); #pragma region SET U V N if(a>b && a>c) { u = Evec.row(0); if(b>c) { v = Eval.row(1); n = Eval.row(2);} else { v = Eval.row(2); n = Eval.row(1);} } else if(b>a && b>c) { u = Evec.row(1); if(a>c) { v = Eval.row(0); n = Eval.row(2);} else { v = Eval.row(2); n = Eval.row(0);} } else { u = Eval.row(2); if(a>b) { v = Eval.row(0); n = Eval.row(1);} else { v = Eval.row(1); n = Eval.row(0);} } #pragma endregion MatrixXd O(3,3); O <<u, v, n; MatrixXd UV(k,3); VectorXd N(k,1); for( int i=0; i<k; i++) { double x = dataPts[nnIdx[i]][0];; double y = dataPts[nnIdx[i]][1];; double z = dataPts[nnIdx[i]][2];; MatrixXd X(3,1); X << x-_x, y-_y, z-_z; MatrixXd T = O * X; double ui = T.row(0).col(0).value(); double vi = T.row(1).col(0).value(); double ni = T.row(2).col(0).value(); UV.row(i) << ui * ui, ui * vi, vi * vi; N.row(i) << ni; } Vector3d S = UV.colPivHouseholderQr().solve(N); MatrixXd II(2,2); II << S.row(0).value(), S.row(1).value(), S.row(1).value(), S.row(2).value(); EigenSolver<MatrixXd> es2(II); MatrixXd Eval2 = es2.eigenvalues().real().asDiagonal(); MatrixXd Evec2 = es2.eigenvectors().real(); double kmin, kmax; if(Eval2.row(0).col(0).value() < Eval2.row(1).col(1).value()) { kmin = Eval2.row(0).col(0).value(); kmax = Eval2.row(1).col(1).value(); } else { kmax = Eval2.row(0).col(0).value(); kmin = Eval2.row(1).col(1).value(); } double thresh = 0.0020078; if (kmin < thresh && kmax > thresh ) cout << x << " " << y << " " << z << " " << 255 << " " << 0 << " " << 0 << endl; else cout << x << " " << y << " " << z << " " << 255 << " " << 255 << " " << 255 << endl; } delete [] nnIdx; delete [] dists; delete kdTree; annClose(); } Thanks, NISHA…
rring to the above image)
Area
effective
effective
Second
Elastic
Elastic
Plastic
Radius
Second
Elastic
Plastic
Radius
of
Vy shear
Vz shear
Moment
Modulus
Modulus
Modulus
of
Moment
Modulus
Modulus
of
Section
Area
Area
of Area
upper
lower
Gyration
of Area
Gyration
(strong axis)
(strong axis)
(strong axis)
(strong axis)
(strong axis)
(weak axis)
(weak axis)
(weak axis)
(weak axis)
A
Ay
Az
Iy
Wy
Wy
Wply
i_y
Iz
Wz
Wplz
i_z
cm2
cm2
cm2
cm4
cm3
cm3
cm3
cm
cm4
cm3
cm3
cm
I have a very similar table which I could import to the Karamba table. But I have i_v or i_u values as well as radius of inertia for instance.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
dimensjon
Masse
Areal
akse
Ix
Wpx
ix
akse
Iy
Wpy
iy
akse
Iv
Wpv
iv
Width
Thickness
Radius R
[kg/m]
[mm2]
[mm4]
[mm3]
[mm]
[mm4]
[mm3]
[mm]
[mm4]
[mm3]
[mm]
[mm]
[mm]
[mm]
L 20x3
0.89
113
x-x
4,000
290
5.9
y-y
4,000
290
5.9
v-v
1,700
200
3.9
20
3
4
L 20x4
1.15
146
x-x
5,000
360
5.8
y-y
5,000
360
5.8
v-v
2,200
240
3.8
20
4
4
L 25x3
1.12
143
x-x
8,200
460
7.6
y-y
8,200
460
7.6
v-v
3,400
330
4.9
25
3
4
L 25x4
1.46
186
x-x
10,300
590
7.4
y-y
10,300
590
7.4
v-v
4,300
400
4.8
25
4
4
L 30x3
1.37
175
x-x
14,600
680
9.1
y-y
14,600
680
9.1
v-v
6,100
510
5.9
30
3
5
L 30x4
1.79
228
x-x
18,400
870
9.0
y-y
18,400
870
9.0
v-v
7,700
620
5.8
30
4
5
L 36x3
1.66
211
x-x
25,800
990
11.1
y-y
25,800
990
11.1
v-v
10,700
760
7.1
36
3
5
L 36x4
2.16
276
x-x
32,900
1,280
10.9
y-y
32,900
1,280
10.9
v-v
13,700
930
7.0
36
4
5
L 36x5
2.65
338
x-x
39,500
1,560
10.8
y-y
39,500
1,560
10.8
v-v
16,500
1,090
7.0
36
5
5
I have diagonals (bracings) which can buckle in these "non-regular" directions too, and they do. If I could add those values then in the Karamba model I could assign specific buckling scenarios..... I can see another challenge which will be at the ModifyElement component, I will not be able to choose these buckling lengths, in these directions.
Do you think this functionality can be added within short, or should I try to find another way to model these members?
Br, Balazs
…
e:
Modulo 1Il workshop è finalizzato a fornire ai partecipanti i fondamenti della modellazione parametrica e generativa attraverso Grasshopper, plug-in di programmazione visuale per Rhinoceros 3D (uno dei più diffusi modellatori NURBS per l‘architettura e il design). Il workshop mira a gestire e sviluppare il rapporto tra informazione e geometria lavorando sui sistemi di involucro in condizioni specifiche. La discretizzazione di superfici (pannellizazione sia Nurbs che Mesh), la modellazione delle geometrie attraverso informazioni (siano esse provenienti da dati di analisi ambientali, da mappe di colore o da database), l’estrazione e la gestione di informazioni richiedono la comprensione delle strutture dei dati al fine di definire un processo che va dalla progettazione alla costruzione.I partecipanti impareranno come costruire e sviluppare strutture di dati parametrici per informare geometrie ‘data-driven’ e come estrarre le informazioni rilevanti da tali modelli per il processo di costruzione.Modulo 2Il workshop, volto a promuovere le nuove tecnologie digitali di supporto alla progettazione e alla fabbricazione, fornirà ai partecipanti gli strumenti per la preparazione, attraverso Grasshopper, dei modelli per il processo di stampa 3d. Il workshop inoltre, darà ai partecipanti i fondamenti dell’uso della stampante 3d e si concluderà con la fabbricazione del proprio modello realizzato durante il corso.
[.] Date:Modulo 1 – 25/26/27 Luglio 2014 – SiracusaModulo 2 – 28/29 Luglio 2014 – Catania
[.] Tutors:Arch. Andrea Graziano (Co-de-iT)Arch. Salvo Pappalardo (Studio Aion)Arch. David Montenegro (Hackspace_Catania)
[.] Luogo:Modulo 1Officina Ermocrate – Viale Ermocrate 7, 96100 – SiracusaModulo 2Hackspace_Catania – Via Grotte Bianche, 112 – Catania
[more info]
…
re my serial port was disappearing all the time when using the Leonardo on my laptop. I could only upload a sketch if I held down the reset button and then released it during the upload process... when the code was uploaded the serial port would immediately disappear again... which means I couldn't load any code which actually sent any Serial communication (which is pretty critical for Firefly). So I showed the problem to David Mellis (one of the founders of the Arduino platform who is getting his PhD at MIT, and he was confounded too). So he put me in touch with one of the main developers of the Leonardo board/platform (Zach Eveland) and I've been working with him to see if we can figure out the problem. As far as I can tell, the issue is that the Arduino driver seems to be failing on Windows 7 64-bit machines (like my laptop). He said one or two people reported similar issues during the development, but that he stopped hearing from them, so he thought it was fixed. We've tried several different things, but it seems the driver is failing at a really low-level. He's ordered a hardware USB analyzer so he can track the hardware communication between the computer and the board... but he hasn't shipped it to me yet. I'm hoping to get it resolved soon. As far as I can tell, the Leonardo is supposed to work almost identically to the Uno (it's just cheaper because it only uses 1 microcontroller... which handles both USB communication and running the code... where as the Uno has two microcontrollers on board which makes it more expensive). So, any code that runs on the Uno should (theoretically) also run on the Leonardo. Other than the code which I added to pick up the board type and load different parts of the sketch (which was a pretty significant overhaul of the firmata)... I only added a few lines to check if the serial port was available before sending the data over to Grasshopper (which seems to be required (or recommended) when using the Leonardo board. I've tested the code using the Uno and Mega and it works great... but I haven't fully tested the Leonardo support because of my machine. Apparently, this issue has only affected laptops like mine (others seem to work fine). If you're interested in testing the new version let me know and I could send it to you. You'd probably have to revert back to 0.8.0066 until I release the next version because David changed a few menu UI functions so I don't think the old version will run correctly (at least I don't think so). Anyway, let me know if your interested.
-Andy…
I am not "expert" enough, I will try to share my opinion.
Judging by the look of the building the simplest way to do it would be using T-spline to create the basic massing (like you try to sculpt a piece of rock to get the silhouette of that building). playing and tweaking mesh is easier in TSPLINE rather than NURBS (in this particular shape). after you've got the basic model done, convert it to NURBS then you can start to use GH to get some complex detail done.
one more advantage is that TSPLINE has special addon for GrassHopper. you can combo them together to get a more unimaginable result.
that is how I would approach the design.
and if you have got extra time,you could rebuild the model from scratch in GH, to get a much "tidier" model. and if next time you do a real project, it is also important to have someone to work on "smart" model like BIM. otherwise the engineer would get a massive headache when he receive your 3D model.
May be this is not a popular opinion, but I think sometimes you don't have to force yourself to build everything entirely in GH. if you can build the basic geometry in rhino, then it is better. afterall GH main function is a modelling aid for rhino. sketching it first on a piece of paper would help to get a better understanding about the geometry you are after. and then you'd know what to do.
one more thing, regarding about one reply, I wanna say, there is a big difference between designers and 3d modeller. as an architect and a designer myself, when I am given a task to design a building, sometimes I dont know what the building is going to look like at the early stage of the design., I prefer a less technical method and keep it as "concept" as possible (as there are many other things we need to think at once, name it, functionality, spacial use, structure, cost, environmental impact,etc etc etc, even politics and government stuff :P)
learning C#/VB/ or other language sure will be a point plus for you. but as dominik nuessen have mentioned, a good understanding of geometry and how it relates to the parametric design is the key point here.
because a good building is born from countless of planning and discussion, do not be afraid to be "wild" during the early stage. remember, some of the greatest architect in the world came from people who are dare enough to connect their dream into the real world.
thats all :) sorry for my bad english :)
…
ython patching via Rhinocommon CreatePatch being 7 of those seconds.
Currently, to avoid failed splits to remove the backgrounds, due to super shallow areas in skinny features that kiss the construction plane, I'm plane cutting a small amount below that construction plane, then moving the result back up.
I'm not using a Patch starting surface, as you can play with in the normal Rhino command, since it just sort of squashes broad curved mounds in ugly fashion, or else pulls them down to make ugly doughnuts everywhere around the input curves.
Details on how to use the CreateSurface command of Rhinocommon, hassles solved, is discussed here, with great all hours help from Peter Fotiadis, and I also discovered some clues from Djordje via Google, where he was massaging points into proper format:
http://www.grasshopper3d.com/forum/topics/python-longer-version-of-rhino-geometry-createpatch-expected
The highest level CreatePatch command doesn't accept a normal Python list of objects in a variable like the two more simple versions of the same command does. You have to regather them into a Rhino container, which is really a .NET container. I still don't know yet how to upgrade the Python parallel patch component to input the whole panoply of objects you can patch over in Rhino because I don't know what container exists to hold them all that won't break the command.
The point of this overall script is to now be able to arrange lots of mere flat surfaces, surfaces because those can define holes versus borders easily, and create real 3D single surface NURBS geometry that can then be surface morphed (equivalent of Rhino Flow Along Surface) onto other 3D models.
…
Added by Nik Willmore at 1:04am on February 27, 2016
d doens't populate the full surface area.
Here the code of the SolveInstance part:
protected override void SolveInstance(IGH_DataAccess DA) { Surface baseSurface = null; int nrBaysUDirection = new int(); int nrBaysVDirection = new int(); DA.GetData(0, ref baseSurface); DA.GetData(1, ref nrBaysUDirection); DA.GetData(2, ref nrBaysVDirection); List<Line> lines = new List<Line>(); List<Point3d> points = new List<Point3d>();
double uPos=(double)1/(double)nrBaysUDirection; double vPos=(double)1/(double)nrBaysVDirection;
for (int i = 0; i <= nrBaysUDirection-1; i++) {
for (int j = 0; j <=nrBaysVDirection-1; j++) { Point3d pt0 = baseSurface.PointAt(i * uPos, j * vPos); Point3d pt1 = baseSurface.PointAt((i + 1) * uPos, j * vPos); Point3d pt2 = baseSurface.PointAt((i + 1) * uPos, (j + 1) * vPos); Point3d pt3 = baseSurface.PointAt(i * uPos, (j + 1) * vPos); Point3d ptM = baseSurface.PointAt((i * uPos) + (0.5 * uPos), (j * vPos) + (0.5 * vPos));
Line lnA = new Line(pt0, ptM); Line lnB = new Line(pt1, ptM); Line lnC = new Line(pt2, ptM); Line lnD = new Line(pt3, ptM);
lines.Add(lnA); lines.Add(lnB); lines.Add(lnC); lines.Add(lnD);
points.Add(pt0); points.Add(pt1); points.Add(pt2); points.Add(pt3); } }
DA.SetDataList(0, lines); DA.SetDataList(1, points); }
and further a screenshot.
Where is my mistake?
Last question:
to script the component I am using the default assmbly from Giulio Piacentino, but when I debug I got this error:
Warning 1 Member 'SimpleGrid.SimpleGridInfo.AssemblyName' overrides obsolete member 'Grasshopper.Kernel.GH_AssemblyInfo.AssemblyName'. Add the Obsolete attribute to 'SimpleGrid.SimpleGridInfo.AssemblyName'. C:\Users\matteo\Documents\Visual Studio 2010\Projects\SimpleGrid\SimpleGrid\SimpleGridInfo.cs 7 32 SimpleGrid
when I do not use this assemblt I do not get this error.
How can I fix it?
Thanks for your help and tips
Matteo…