am to find the coverage for various public-transport stations and is interested under what conditions that coverage will poorly represent reality, then that would fit perfectly within your proposed forum, but the SO people will close it as off-topic before you can say directed-infrastructure-networks.
Or discussing which properties of a transport network would be sufficient to encode into a graph in order to give a model accurate enough for early design iterations.
Or discussing the fabrication costs under various manufacturing methods of elements (a, b, c, ...) with amounts (K, L, M, ...). ie. is it cheaper to manufacture façade panels using manual welding if I have 50*a + 50*b + 25*c or would it be cheaper to have 120*a + 3*b + 2*c?
Or discussing the visual aspects of various types of geometry. Do Bezier or Akima splines look more natural? What about them makes them look natural/unnatural? Can people tell the difference between a perfect circle and a circularish Nurbs curve with 12 points? Does it matter whether the Nurbs curve is small or big? Next to a perfect circle or not? Horizontal or vertical?
What equation would better describe experienced time by humans travelling from A to B rather than measured time?
How can I find out under what wind conditions this sharp edge on my building will start whistling?
How much might the potentially bad smell of this cheaper material lower the value of my building?…
, August 2004.
I know, this has been done a million times, and I'm not sure, but there are probably already scripts like this one on Grasshopper3d. Still someone asked for help, and I thought this might be useful.
I added the script as a gh (python) component and as a python module. Feel free to fiddle around with the code.
For a graphic description:
…
Added by Jesus Galvez at 11:47am on October 8, 2014
taTree.
2. Since GH is acyclic by design we can't pick individually (without code, that is) our "picks" for the iceberg ... thus we need a global policy applied to ALL grid points at once.
3. This is what the next part does: it picks randomly some iceberg stuff and modifies their Z by a random value. If the Z is always "above" the grid or not it depends upon the domain of values to operate. Seed means "roll the bones again" (meaning another collection).
4. So we have the modified points Data Tree (that are steady - acting as the tips of the iceberg). Let's call them Anchors.
5. If we subtract set 4 from 1 we have the points prone to vary according some manipulation. Kangaroo does that manipulation (this is the best add-on that GH has to offer by 1M miles made by a very clever fella).
6. But if we instruct Kangaroo to do the job... he makes chaos since the points in 4 are not sufficient: we need perimeter steady points that act as Anchors as well. So we manage some logic to pick a variable set of perimeter points and we "merge" 4 and 6 and we have the final set of Anchors on hand - whilst all the rest are points willing to change.
7. Kangaroo is a physics engine meaning that the only thing that understands is ... er ... points and their relation (the "line" connecting them, that is). Kinda like a CPU that understands 0 and 1 and nothing else.
8. So we provide Kangaroo info about all the lines involved: how "stiff" they are and what is the expected/desired final length.
9. By double clicking the Kangaroo component ... the "simulation" starts running (in some kind of "loops") and goes towards an "equilibrium" where all our desires are satisfied - or the solution's entropy is the minimum possible (well up to some level, he he). Kangaroo displays a small control dialog that allows you to halt the process or reset it (meaning: start again).
10. If the instructions are "good"/"proper" the "loops" (iterations) are relatively few: if K does 1M "loops" ... this means that your instructions are silly or not well thought.
After stopping Kangaroo ... we have (hopefully) a "well" distorted collection of points (and their equivalent mesh) to proceed further via components usually found in the WB add-on
PS: If all the above sound Greek to you ... it's because I'm Greek, he he.
Moral: Get the gist of Kangaroo ASAP - worth spending some time I recon. If you do that and you need examples (other than the ones available at download time) ... well I have more than 300 (from simple to ultra paranoid).…
d index errors).
This may end up something like this:
if (PG.BranchCount == 0 || PG.DataCount == 0) {
// perhaps a minimum branch count/data count?
// make the error a bit more visible than print.. Component.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "no point tree on sight");
// adds a yellow warning box instead of an angry red box
//Component.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "no point tree on sight");
return; }
This is also a bit nicer, because of the return, you don't have to wrap your whole script in a if/else clause.
Case 3:
It's either:
PQH.AddRange(PQL, new GH_Path(b, i));
or: for(int k = 0; k <= PQL.Count; k++){ PQH.Add(PQL[k], new GH_Path(b,i)); }…
ctly.
But vertextopolgy is not the same and it shifts from frame to frame. I see all mesh faces correctly too.
Or is it possible to change the vertex typology order of the mesh?
Mesh[] tempMeshes = new Mesh[meshes.Length];
int loop = 0; for (int k = 0; k < meshes.Length; k++) {
Mesh tempMesh = meshes[k].DuplicateMesh(); var tp = meshes[k].TopologyVertices;
for (int i = 0; i < tp.Count; i++) { int index = tp.TopologyVertexIndex(i); tempMesh.Vertices.SetVertex(i, PS.GetPosition(loop + index)); }
loop += meshes[k].Vertices.Count;
tempMeshes[k]=tempMesh;
}
DA.SetDataList(0, tempMeshes[0].TopologyVertices);//Order that changes from frame to frame DA.SetDataList(1, meshes[0].TopologyVertices); //Original order DA.SetDataList(2, tempMeshes[0].Vertices); //Same order DA.SetDataList(3, meshes[0].Vertices); //Original order
…
sis by applying the loads on the deformed shape. This is done by steps or, in other words, in each step karamba applies a portion of the loads, computes the deformation and on this new configuration applies another portion of the loads and so on.
Now focus on what “portion” means.
One way of “portioning” the loads is to divide them in n parts (whit n= number of steps) and then applying in each step one part. For example, if you set 10 increments, in the first step the system will be loaded with the 10% of the loads, in the second with the 20% and so on. (I really don’t know if this is a linear proportion or not, but the concept is the same: a numerical division of the total loads).
Another way is to take that part of the loads that produces a fixed displacement. You know that F=ku: k is a property of the system, so it is fixed; setting the MaxDisp input you can compute u=Maxdisp/inc; so you can get F.
As I said before I am not sure of what I have written.
Tell me what you think!
Francesco
…
me you can "shape" them.
In plain English (for your pavilion): you define the path (the ellipse) and then you control (on a per item basis) these panels (shape, position etc etc) prior storing them into some collection. What is the "usual" way? The wrong one: you mastermind some logic, you get the SUM of panels and then we spend time and effort to clean the mess.
And why it's a mess? Because in quite a few cases we need control over items and not over the collection of items.
Of course I could create a "correction" C# that does far more better things (than the one provided) in order to clean/clear the mess ... but compare the time to think/test the code VS the time to put these panels in place on a per panel policy. It's like buying a Toyota Prius (Yikes!) and spending time/effort to make it a Lotus Elise (the ultimate affordable sports car).
PS: you can't buy a 917: only available in auctions (at around 300++K). This immortal racer (against popular belief) is not the most successful racer of all times: the crude Viper (tractor 8L engine, push rods, 5K rpm etc etc) had won 7 times more trophies.
…
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…