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…
y interesting and smart way to construct surface. I tried some experiments out using a similar idea - take a developable surface which has a series of holes cut through it now offset that surface and unroll both of them, once both have been cut out insert a dowel into the holes (the dowel represents the offset distance). In the end the shape is recreated via tension and in that way there are some similarities. With your concept the thing I have trouble figuring out is how do you cut the variable angle kerfs. Are you using a 5-axis swarf cut, a cnc panel saw - how do you control this? It would be great to have a set of constraints which limit the number of possible angled cuts - these limits would equal the number of v-groove bits you have in the cnc - and then you could just cut the lines with the programmed tool which matches the given angle. Or maybe I am completely wrong, now I think I am wrong, about the execution and you are only changing the gap between each kerf and the angle of the side wall stays constant.
Anyway to answer your question catia can analyze the characteristics of a piece of formed material (this analysis is usually applied to sheet metal and to design forming tools)it's just a matter or defining the material to match that which you are using. Another possibility although not as numerically clear is using a simulation tool like Maya cloth or Virtools. I know this maybe less likely but you can define all sorts of materials in Maya and then simulate their behavior under numerous forces and constraints. I think it would work it's just how do you extrapolate the values Maya needs and then correlate them back into the cloth parameters. Once it yields the final formed mesh then further analysis could be performed in cosmos, ansys, or catia.
I have one other suggestion. In solidworks if you perform a lofted bend on a sheet metal part and then generate a flat pattern it creates a large set of bend lines representing how to perform the bending of an unusual shape using a metal brake. It seems like those bend lines could be machined with you technique to create lofted forms instead of extrusions.
What materials seem to work best so far, have you only been using wood (the purple stuff is probably not wood)?
If you are ever in Los Angeles I have a shop with a 3 axis and 5 axis router, a large vacuum bag, and all the other things to experiment on this and would be open to this.…
Amuse yourself by trying to figure what kind of series logic could deploy (or not) these room unit combos across the blue space grid shown.
2. Let's assume that surgery etc etc departments are sited in some ground floor and their requirement for rooms is variable ... meaning that some kind of heuristic GH approach must be applied here (for instance : fill the first level with rooms required by all departments with min distance from a given core and if more are required go to next floor etc etc).
The real room unit cluster looks like that (all units are prefab)
3. Voids in the whole cluster deployment (avoid Soviet type of bloc aesthetics) mean that culling could be challenge here (we need ...er..."visual" culling , so to speak)
4. After finishing some solution create custom preview(s) in order to visualize what dept owns what rooms.
5. If in trouble with Architectural things > relax > be cool > open 3d PDF > be a great Architect in just 10 easy steps.
PS: of course I know GH clusters...but as they are they violate my rule N1: never walk the walk if no return is possible, he he. But assuming that David could resolve the return issue (sure he can) this is NOT the answer for my "proposal" for multiple Canvas - again like multiple Views in any CAD stuff these days. Just imagine clusters with some serious hierarchy depth > where am I ? what input comes from what output?
I'll be back with a chaotic case (Series in complete anarchy) in order to demonstrate the critical necessity for a visual Tree Manager/Viewer (a visual thing within the GH visual thing). For manager read : decomposer, composer, visual identifier (per data item/branch) tree re-mapper, anything actually.
more soon (and a in depth analysis about what a Tree Manager/Viewer should do - in an ideal world, that is)
Cheers, Peter
…
which needs to go in the first line only.
Each value K is one element of the knot vector
XYZ is an individual control point. Each point gets its own line/string in the output list
R is the weight of the XYZ point defined in the same line
I can get all these data into separate lists easily enough using the buttons etc. But getting them into the proper order and moving stepwise down the data to generate the desired output string list is eluding me so far.
My thought is to make an array of columns.
Column one is a list of knot values.
Column two is a list of X values.
Column 3 = list of Y values
Column 4=z values
Column 5 is weight values
etc
The idea would be to read the first value in each list into a list of five elements, then make a string out of it. The second value of each column into a separate string on the next line, then the third value from each column into the third string in the output list and so on.The last few values in the output list will contain knot vector elements only, as there are more of these than there are control points. Some of these curves are very long, with many control points, like hundreds and hundreds.
It seems I should be able to pull the lists of interest and combine them into a tree somehow; so far all I have been able to manage is to get them into a single list by starting with control points, then weaving each list of interest successively into the growing list. I'm thinking I need to get the list for each parameter into an individual branch, then read a path across the branches at each index value. But I am missing something about the terminology. I have watched a few videos and it makes sense when people are pulling nested geometry out of models, but this is a little different. More of a data management issue. I'm sure if I wrestle with it I will get it, but it may not be pretty. Any pointers appreciated. A couple of approaches are attached. Not sure whether to loop a list subset through the data or do something else. Thanks,
Karl in LA…
urely; an inevitable symptom of developing a piece of software on what Generative Components was doing almost 10 years ago, and creating a generation of users who have the power but not the insight in to how to use these tools properly. Ever seeing, never perceiving.
@ André-Jacques BODIN: as answers so far seem to be coming via links, try this: http://www.bentley.com/en-US/Products/GenerativeComponents/
you can download the latest version for free and it is infinitely more superior to GH. The learning curve is steeper but worth it. Out of experience I can tell you that the problem you have would be solved via your own skill and intelligence in a matter of seconds, rather then clumsily relying on somebody else to write some code 'packaged' as a component, and ultimately restricting your capacity to explore novel design solutions in an intelligent way.
If you are going to work in practice then unfortunately GH becomes utterly useless as it can only really be used in the initial stages of design. Its merely a toy for students and hobbyists. If you are just starting out, invest your time more wisely and learn something which can be used over the entire life cycle of project. It's so versatile that you essentially have unlimited potential and all operations remain fully in your control, or put in another way; you're not restricted by the idiosyncrasies of another programmer who's 'components' might be totally unsuitable for a novel idea you may want to explore therefore killling it.
…
t you're trying to do something which is not possible. Some solutions spring to mind other than changing the messaging behaviour of the Tree Item component:
Have an option for all objects (not just Tree Item) that allows you to disregard warning and error feedback. Sometimes a component has warnings (or indeed errors) and yet it still functions as planned. This often also happens with auto-casting, for example if you're trying to find all the curves in some data. Pros: solves the same problem in the same way everywhere, Cons: yet another menu item and yet another thing to watch for.
A global switch that disables the warning and error colouration. Pros: easy fix, easy unfix. Cons: if you also disable message balloons then you can't see where errors are happening.
Add a component which filters valid paths and item indices which you could insert in front of the Tree Item component. Pros: a very Grasshopper standard solution, Cons: yet another esoteric component.
I've been thinking about changing the way branches and items are accessed. Basically wondering whether it makes more sense to combine the tree path and the item index into a single data-type "{0;0;2} (0 to 9)" which defines both the path and a range of items in that path. It could be made to work almost identical to current Tree Branch and Tree Item components but it could also do some other cool stuff in addition to that. For example you could have:
{0;0;1} which defines all the items in that branch
{0;0;1} (2) which defines the third item in that branch
{0;0;1} (0,1,2,4) which defines the first, second, third and fifth items in that branch
{0;0;1} (0 to 4) which defines the first 5 items in that branch
{0;0;1} (!3) which defines all items except the fourth in that branch
And I'm sure people can think of even more combinations of symbols and numbers that can be added. Most of this logic is already in place in the [Replace Branches] and [Split Tree] components.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 12:58am on January 27, 2013
e in Euclidean space then the distance metric can be discontinuous:
Discontinuous means that a tiny change in input may result in a large change in output. Observe the image above, we start measuring euclidean distances from point A. At first the process appears to be continuous. We measure at distance b and we get point B. We increase the distance slightly to c and we get point C, which is very close to point B. We increase the distance slightly again to d, but now suddenly we're in a completely different location. This jumping behaviour can mean that certain questions (such as: "how do I divide this curve into 4 points, all equally far apart?") do not have an answer. It could be possible for 3 and 5, but not 4.
Another problem is that there may be multiple solutions. In the image above the point D isn't the only point that is d units away from A and coincident with the curve. There may be any number of those points depending on the shape of the curve, the location of A and the value of d. And of course once you have two (or more) solutions, you can have two (or more) answers. Then each of those solutions may yet again have more than one outcome for the next point in the chain and before you know it the question you asked has 35295 different answers and good luck trying to find one you like.
Now of course sometimes it is possible to answer your question unambiguously. I made a solution that uses Galapagos. It's pretty slow, and it'll get slower the more segments you want:
--
David Rutten
david@mcneel.com
Tirol, Austria…
Added by David Rutten at 4:26am on September 9, 2013
rid that works on the left and/or right edge of the components, so that it's easier to align them (similarly to the align functions that show up when multiple objects are selected)
Overall, I think we'd just need a basic grid for alignment, so whatever is easy/quick to implement might be good enough.
4) great, I didn't know about aliases - that pretty much answers my question.
Related to this, when I press F4 and search for a component, if the mouse/pen pointer is above the list, when I press enter Grasshopper will insert the component under the pointer, and not the one I have found with the keyboard. Am I missing something? In case could it be fixed?
As a side note, at the moment the keyboard focus is always on the Rhino Command Line. Would it be possible to optionally change the focus when the Grasshopper window is active so that we can insert new components just by typing, without pressing F4 or doubleclicking? I just find myself constantly using the keyboard to insert components, so that'd be a very nice timesaving.
5) Your idea would be great to manage complex panels and I think would be very nice to have.
However I was thinking of a different workflow, that could be useful - for instance - when working with several objects in Rhino that are referenced in Grasshopper as basis to create more complex objects.
For example: I have three different surfaces that are used to create framed grille elements. It would make sense to select these surfaces in Rhino and access to a panel that shows the element properties (for example frame dimensions, type of grille, etc.) - similarly to the property panel in Rhino.
Additionally, If I need to create a new grille element from another Rhino surface, I could just duplicate the RPC component along with the definition without the need of manually publishing all the parameters to a new RPC group. I hope this makes sense.
I understand this may not be an "urgent" feature, however I find that working with RPCs is very pleasant so I'd really like to see this feature expanded in some way :-)
6) Just perfect :-)
Thanks again David!
Marco
…
r planet Utopia?
2. In what sort of animal these "shaders" are to be used? Meaning that designing a "Viz" control for 2345,67 mini-membranes is one thing and doing it for your house is a totally different challenge. In plain English: it's more than possible to hit the Wall if lot's and lot's of items are invited to the party (you bring the girls and I'll provide the Vodka).
3. Do you like the idea of completely separating (on a spatial basis) input/viz control (what is on display and on what level of "detail") from the core logic (i.e. components). Pros: obvious, Cons: obvious.
4. Is this def planned as a "constant" evolution thing? Meaning that using, say, the mapper isn't the best idea if your input goes from {a;b;c} to {a;b;c;d;g;...;z}.
5. Have you any - even academic - plans (see 1) to walk the walk up to the end?. Meaning talking to Birdair/Taiyo Kogyo etc etc ( http://www.birdair.br.com/ ). If yes be prepared because these fellas work a bit differently as regards potential collaboration and feedback at design phase.
BTW: the thing that would change the world as you know it:
http://www.birdair.br.com/tensileArchitecture/tensotherm.aspx
best, Peter
…
ts (other than Kangaroo - if required). Anyway notify if you want some taste of them (but they are a bit "chaotic" : too many parameters etc etc ...). Warning: Almost all are written with MCAD apps in mind: GH is used SOLELY as a graphical editor/topology solver and just makes the simplest instance definitions possible in order to send them (via STEP) to some MCAD (Frank G uses CATIA/Digital Project as you may probably know, CATIA is my favorite toy as well) for actually designing the components and composing the whole.
2. "Equality" in modules (panels/glass/lexan) it's not an issue (other than aesthetics). I mean cost wise since modules are prepared via CNC these days. I wouldn't suggest to waste your time with "equality" puzzles and completely ignoring the big picture (real-life) that is FAR and AWAY from aesthetics. I mean: assume that I of someone else or Daniel can "equalize" things (up to a point): Is this sufficient for designing a similar real-life solution? In plain English: don't get occupied by the tree and ignore the forest.
3. As regards the frame in most of cases some MERO type of modular system is used: either a "flat" dome-like arrangement or a classic spaceframe or a hybrid system [push: tubes, pull: cables]. Hybrids are the most WOW (and costly) for obvious reasons. When properly done (and combined with a planar glazing system) THIS is the star of the show.
4. As regards the skin we use either "hinged" custom stuctural/semi structural aluminum extrusions (they can adapt to different dihedrals up to a point) or classic custom planar SS16L systems that also can adapt to dihedrals. A custom planar glazing solution is hideously expensive, mind (say: 1K Euros per m2).
5. Smart Glass tech (changes light transmission properties under the application of voltage) is gradually penetrating the market especially in future bespoke designs.
So in a nutshell: these are "pro" territory - if I may use the term, thus I don't expect to find ANY similar "turn-key" solution in the very same sense that you can't find a tensile membrane turn-key solution.
Meaning that practices that can do it ... er ... they keep the cookies for themselves. …