e making on the surface in each direction. There are several ways you can go about this, but I think the easiest would be to either create the UV points for the isocurves manually or extract the points you want from the UV list..
As to surface coordinates versus world coordinates. The Isocurve component wants to be fed coordinates that represent 2D space. For example, if I had 2 surfaces that both had U and V domains of 0 to 1 and I fed a UV value of 0.5,0.5 to both, it doesn't matter how different those two surfaces are, because I'm expressing that point in relation to the 2D parameterization of the surface itself. Evaluating the surface at that 2D point then leads to a 3d coordinate expressed in world space.
Surfaces do have a third dimension, which is commonly refered to as W. The axis/direction of this third dimension is the normal of the surface at that point. So "technically" supplying a third coordinate value should also represent the point moving along that normal. In practice however, this is only really supported on operations that actually deal with normals on some level or another. So evaluating the surface wouldn't be one, but doing something like displacement would be something that might be interested in that third W value.
In GH, there is no 2 coordinate point because there's just no need for it. It would just be some extra components that would clutter up the space and do pretty much nothing beyond what could already be achieved with a 3 coordinate point.…
Added by Damien Alomar at 9:10am on December 19, 2009
)….
Volevo chiederti una cosa... se posso…
Sto’ cercando si seguire questo tutorial e sono 3 ore che non ne vengo a capo…quindi preso dalla disperazione ho deciso di scriverti…
In questo video tutorial:
http://www.youtube.com/watch?v=AP5PxBn_5rc&feature=related
Nel primo minuto e mezzo spiega come i punti che escono dal “divide surface” nel “Panel” giustamente sono 4 perche’ sono i vertici…il mio problema e’ che per avere i vertici io devo dare come imput UeV un integer 1….altrimenti ogni singolo pannello e’ diviso in piu’ parti e non ho piu’ i vertici…ma se faccio questo, il mio autput di punti ha una lista 0 e 1 invece che, come succede a lui, 0,1,2e3. Quindi non capisco proprio che imput da lui nel U e V del “divide surface” e se faccio qualche errore…
Se hai voglia e tempo potresti spenderci 2 minuti per darci un'occhiata?…. Grazie!
Ciao!…
Added by raul forsoni at 10:44am on January 13, 2010
-between the two existing surfaces, and the isocurves of the surfaces which are in-between the U’s and V’s of the existing two.
I’m unsuccessful in a couple of things:- Now I’m using the SubSrf Isotrim, which I think makes the definition heavy and, for now, I don’t need the isotrimmed surfaces, but just the isocurves.- The other issue I can’t solve is that I sometimes have two surfaces as inputs which have a different surface plane (like srf 3 in the rhino model). What happens, is that the lines in-between the two, are twisted.- And the third, more general question, is: How can I turn trimmed surfaces into NURBS surfaces (in rhino or grasshopper), so the Divide Srf component works based on the edges of the surface, instead on the edge of the untrimmed srf.I know the following works for one trimmed surface, but I guess it might be a bit overdone (and doesn’t work for multiple surfaces): Input trimmed srf > Explode Brep > use the vertices > exploded in four outputs > use them as input for Srf4Pt.Still in the learning process so please tell me if I do things which could be done must easier. And thanks in advance!…
my algorithm has some problems :
1 . the base of spikes should be a circle i guess mine is hexagonal
2. the tip of the spikes should be closed mine are open !
3. i cant achieve an attractor point / field force effect for the spikes (for example if i move a point the spikes tend to go towards that direction)
4.the smoothness of the spikes !
5. the length of the spikes (this one should be linked to the attractor i guess )
image#1 image#2
thanks a lot for reading and i will be grateful if you could help me solve the problem
…
of the point cloud. It is super quick, compared to what you have seen so far in Rhino, to load and display point clouds, as it works on multiple threads. Amongst others you can section the point cloud for referencing your footbridge, decimate it as needed for creating the enviroment, denoise it, clip and save parts of point clouds etc. You can right click the cloud components, giving you access to dynamic preview of the cloud, so that it does not drag in viewport while panning and zooming and at the same time controlling the "thickness" of the points in viewport, in case your camera gets close to the point cloud. It is a matter of visual preference.
I think that even 200mil points can be loaded with volvox.
Some references
12million points
13million points
13million points (right click dynamic settings low thickness)
13million points (right click dynamic settings high thickness)
15 million points (around 20sec!! to l0ad)
My pc (i7 3820, 32gb ram, gtx670 4gb) felt comfortable working with up to 15 mil point clouds. But that has to do with hardware along with your patience while working.
All clouds have been loaded as .txt files where the mask describing the info was x,y,z,r,g,b,u,v,w. Depends on how your data is in-text formatted.
You can check fly through animations all done with gh and Volvox here
(starting @~2:20)
best
alex
…
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…
b RunScript(ByVal srf As Surface, ByVal startPT As Point3d, ByVal startVEC As Vector3d, ByVal intMAXbounces As Integer, ByVal coef As Double, ByRef reflectionPointList As Object, ByRef contactPlanes As Object, ByRef valuePointList As Object) Dim originPt As Point3d = startPt Dim dirVec As Vector3d = startVec Dim surfaceNormal As New vector3d Dim outputPts As New List(Of Point3d) outputPts.Add(originPt) '''Dim outputPlanes As New List(Of on3dvector) '''Dim outputNormalPlanes As New List(Of On3dVector) Dim n As Integer = 0 '''Dim blnSwitch As Boolean = False While n < intMaxBounces '''Dim bounce As New On3dRay Dim shooter As New OnRayShooter Dim hit As New OnX_EVENT Dim plane As New OnPlane hit.m_type = RMA.OpenNURBS.IOnX_EVENT.TYPE.csx_point shooter.m_min_travel_distance = doc.AbsoluteTolerance() shooter.Shoot(originPt, dirVec, srf.toArray(), hit) Dim intIndex As Integer = getSrfIndex(srf, hit.m_pointA(0), hit.m_b(2), hit.m_b(3)) originPt = hit.m_pointA(0) If originPt.CompareTo(onutil.On_origin) = 0 Then '''print("exit") Dim lastPoint As Point3d = outputPts.Item(outputPts.Count - 1) Dim newPoint As New Point3d newPoint.x = (dirVec.x * 100 * coef) + lastPoint.x newPoint.y = (dirVec.y * 100 * coef) + lastPoint.y newPoint.z = (dirVec.z * 100 * coef) + lastPoint.z outputPts.Add(newPoint) Exit While End If surfaceNormal = srf(intIndex).normalAt(hit.m_b(2), hit.m_b(3)) '''plane.CreateFromNormal(hit.m_pointA(0), surfaceNormal) dirVec = reflectVector(dirVec, surfaceNormal) '''outputNormalPlanes.Add(dirVec) outputPts.Add(originPt) '''outputPlanes.Add(dirVec.PerpendicularTo(dirVec)) n = n + 1 End While If outputPts.Count > 1 Then reflectionPointList = outputPts.ToArray() '''contactPlanes = outputPlanes.ToArray() '''normalPlanes = outputNormalPlanes.ToArray() End If End Sub
'<Custom additional code> Function getSrfIndex(srf As list(Of Surface), testPt As point3d, u As Double, v As Double) As Integer Dim intIndex As Integer For i As Integer = 0 To srf.count - 1 Dim srfPoint As New point3d srfPoint = srf(i).pointAt(u, v) If srfPoint.distanceTo(testPt) < doc.AbsoluteTolerance Then intIndex = i Next Return intIndex End Function
Function reflectVector(incomingDirection As vector3d, surfaceNormal As vector3d) As vector3d Dim tempVec As New vector3d tempVec = incomingDirection tempVec.Reverse() tempVec.Rotate(onUtil.On_PI, surfaceNormal) Return tempVec End Function
Thanks,
Phillip…
e radius). I used David Stasiuk Cocoon in order to make the shape. http://www.bespokegeometry.com/2015/07/22/cocoon/
After being happy with the shape I toggle the final generation of mesh from Cocoon with a subd of 1 (126,792 faces). I then calculate direction I want for the pattern, here the same directions as the nearest curve. Surely not the smartest way of doing but it works.
After that Reaction Diffusion could be used. A good site to understand is http://www.karlsims.com/rd.html A good site to choose feed and kill values is http://mrob.com/pub/comp/xmorphia/index.html In order to modify the size of the pattern I use B diffusion and also the size of the mesh. The directionality is controlled by _factor > 1 and pattern will follow tangents, and < 1 pattern will be perpendicular to the tangents.
Here differents parameters to play with
This script could surely be used to replicate Nervous Reaction design, thanks to them to their creativity. http://n-e-r-v-o-u-s.com/Laurent Delrieu August 2015…