housing for an LED PCB. The object is a parametric series of discs with an opening inside made up of a mirrored curve [drawn in Rhino, mirrored in GH]
It is madde up of N number of discs which can be varied through the distance between the circular outline using a divided curve [straight line in GH]. The length of the object can be varied using a length parameter, and the shape using a graph mapper.
I've chosen to cap the end two discs by creating two sets of outlines. One set has the central aperture cutout for the PCB, whereas the other set is a trimmed circle [achieved using the "trim box" layer profile in Rhino]
I then cull the outer two curves from one array, and the inner N-2 curves from the inner array.
The final outcome I am after is to create the housing as both an STL and a 2d template for laser cutting. This is a learning exercise for me as well as a cool project.
I had it working OK, but then I adjusted the profile for the PCB and joined it and now it is giving me some grief. I am sure the answer is obvious. The problem is the PCB profile is made up of 3 polycurves, whereas the disc profile is one planar curve. I have no problem using the flatten option so there are only N sets of curves coming out of the "Join Curves" component. However when I cull the curves, the planar curves making up the exterior edge cull fine, but the interior curves [the joined, PCB profile] culls in a different [irrational?] order to what I would expect. If I connect the single planar curve to the culls section, it works fine, but the joined line section just won't play.
In the instance uploaded N = 10, based on spacings. And index white it appears that 0 and 9 are diagonal to what I'd expect, although if you fiddle with the values they go all over the place.
Can someone please help me and explain what I did wrong? Files are attached... I have screen grabbed the relevant section, but it is grouped in red and labelled as "problem child" :)
Many thanks for your help, sorry if this looks like a clusterf**k, first time for everything... any advice very much appreciated, not just relating to my problem.
All the best
Nick…
difference consists of.
An Evolutionary Solver/Genetic Algorithm is an implementation of Metaheuristics. Metaheuristics tend to be flexible solvers, applicable to a wide variety of problems, fairly easy to implement, but slow. Other examples of Metaheuristic algorithms would be Random Search, Scatter Search, Simulated Annealing and do on. These algorithms are often modelled on physical or biological processes.
Simulated Annealing for example simulates the physical process of annealing (who'd have thunk it), which is basically the slow cooling of a material which allows it to settle into a crystalline lattice, i.e. a low energy distribution of all the atoms. I'm currently adding an SA solver to Galapagos, and in fact just yesterday managed to get the first successful run: http://www.youtube.com/watch?v=VWtYLv-4oP0
Metaheuristics are especially useful for those cases where little is known about the problem ahead of time. If the problem search-space is mathematically well defined (differentiable, especially), then you can use more targeted algorithms such as the Newton-Raphson method, Pareto-search or Uphill search. You can still use these methods on non-differentiable search-spaces, but it involves sampling the local region to death to get an estimate of the differential. This can be a very costly enterprise, especially in high dimensional search-spaces. In a two-dimensional search-space you'll need 3 to get a lame estimate and 4 to get a halfway decent estimate and 8 to get a good estimate. In three-dimensional search space you already need 26 samples, and the number of samples grows exponentially with higher dimensions.
If you have a specific problem you're trying to solve, Metaheuristics are probably not the best solution, even though they may be easiest to program. Rhino uses something akin to Newton-Raphson for certain problems and that's fast enough to run in real-time.
Divide-and-Conquer algorithms are also quite popular. Sometimes they are called Binary-Search or Tree-Search algorithms as well. Their basic premise is to sample the search-space at a few intervals (but enough to capture the needed detail), then find two neighbours with promising values and sample again in between these two. Then repeat. Each new iteration typically doubles accuracy, which is great because then you only need ~30 ~40 iterations to get an answer as good as possible with double-precision floating point accuracy. However not all problems lend themselves well to this sort of search and in higher dimensions it starts getting slow with disconcerting alacrity.
--
David Rutten
david@mcneel.com
Poprad, Slovakia…
Added by David Rutten at 1:54am on August 15, 2011
user to understand. RhinoScript is a generally more straightforward and easy to use. You can think of it as a translation of RhinoCommon so that you don't have to write all the technical stuff.
In your first line you've said "import rhinoscriptsyntax as rs". To see the methods you can call from this library you can go to the help menu and choose 'Help for Rhinoscript'. It will show you a searchable window of all the the options you have. This is much easier for new users to learn than looking at the RhinoCommon SDK.
If you search the help file for 'BoundingBox' you'll get the screen capture below:
At the bottom you can see an example of how to use it. In your case you would replace the following lines:
2/ boxA=brepA.GetBoundingBox((0,0,0,)) --> boxA = rs.BoundingBox(brepA)
3/ boxB=brepB.GetBoundingBox((0,0,0,)) --> boxB = rs.BoundingBox(brepB)
The script you have written uses elements of both RhinoScript and RhinoCommonSDK. I would suggest you might start just using RhinoScript. See below, I have re-written the first 8 lines of your script using just RhinoScript:
import rhinoscriptsyntax as rs
#Get BoundingBox from breps.BoundingBoxA = rs.BoundingBox(brepA) #Returns list of eight corner points.BoundingBoxB = rs.BoundingBox(brepB)
#Get centre point of RhinoScript BoundingBox (which is a list of eight points).boxA = rs.AddBox(BoundingBoxA) #Generate box from corner pointsptA = rs.SurfaceVolumeCentroid(boxA) #Get Volumetric Centroid of boxboxB = rs.AddBox(BoundingBoxB) ptB = rs.SurfaceVolumeCentroid(boxB)
For reference the following will achieve the same thing using RhinoCommon, fewer lines, but more technical. There are a few other quirks as well, for example you have to explictly tell the python component what kind of object 'brepA' is. See below for example of same script in RhinoCommon:
import Rhino as rh
centerPtA = brepA.GetBoundingBox(rh.Geometry.Plane.WorldXY).CentercenterPtB = brepB.GetBoundingBox(rh.Geometry.Plane.WorldXY).Center
I'm not sure what you are trying to achieve overall and your loop doesn't make a lot of sense to me but I hope that clarifies some of the differences between the two libraries you can use.
Regards,
M…
own use and added the command line port LPT1 port dump.
I found a couple of strange things in your code:
# Changes the model units to inches, but does not scale model.rs.UnitSystem(unit_system=8, scale=False)
Why did you change the model units here? HPGL units are 40 per mm (which is also 1016 per inch) staying in mm units in your model will be fine if your step scaling in right.
And doing this seems strange for a cutting program:
allCurves = rs.ObjectsByType(4)for curve in allCurves: if (rs.CurveDegree(curve) == 2 or rs.CurveDegree(curve) == 3) and rs.IsPolyCurve(curve): rs.ExplodeCurves(curve, True)allCurves = rs.ObjectsByType(4)
Cutting usually needs a closed curve to produce a nice clean removable piece from the material. Your approach results in a bunch of line/curve segments instead of closed polycurves/polylines. As this simulation shows the 'O's and 'R' are cut as a collection of curve segments - not closed polycurves:
I just removed this step from the code.
As this simulation shows every part of the font is cut in one cut action - exactly what I needed:
I saw your RVB code on the RhinoScript site too - was way more detailed than I needed - my vinyl cutter only has one 'pen' - the cutting blade. I just needed a really basic way of getting polycurves into HPGL format and firing it out to a printer port.
Thanks for your help on this little project - I'm very stoked at the result! Let me know if I can help with your cutter project.
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…
,with OpenfoamV1612+ in Windows 10 64bit.The blockmesh worked good.And the snappyhexmesh crashed in the process.My computer memory is not enough? Or some settings wrong?Could you help me solve this question?/---------------------------------------------------------------------------| ========= | || \ / F ield | OpenFOAM: The Open Source CFD Toolbox || \ / O peration | Version: v1612+ || \ / A nd | Web: www.OpenFOAM.com || \/ M anipulation | |*---------------------------------------------------------------------------*/Build : v1612+Exec : snappyHexMeshDate : Aug 27 2017Time : 09:39:54Host : "default"PID : 13443Case : /home/ofuser/workingDir/butterfly/outdoor_airflownProcs : 1sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)allowSystemOperations : Allowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //Create time
Create mesh for time = 0
Read mesh in = 2.14 s
Overall mesh bounding box : (-241.5472 -241.4418 0) (496.4376 536.2438 144.8633)Relative tolerance : 1e-06Absolute matching distance : 0.001081851
Reading refinement surfaces.Read refinement surfaces in = 0.01 s
Reading refinement shells.Refinement level 3 for all cells inside around_buildings_area.stlRead refinement shells in = 0 s
Setting refinement level of surface to be consistent with shells.For geometry outdoor_airflow.stl detected 0 uncached triangles out of 120Checked shell refinement in = 0 s
Reading features.Read features in = 0 s
Determining initial surface intersections
Edge intersection testing:Number of edges : 1684728Number of edges to retest : 1684728Number of intersected edges : 5583Calculated surface intersections in = 1.68 s
Initial mesh : cells:554112 faces:1684728 points:576779Cells per refinement level:0 554112
Adding patches for surface regions
Patch Type Region
outdoor_airflow:
6 wall buildings
Added patches in = 0.03 s
Edge intersection testing:Number of edges : 1684728Number of edges to retest : 0Number of intersected edges : 5583Selecting decompositionMethod none
Refinement phase
Found point (127.4452 147.401 72.43167) in cell 402042 on processor 0
Surface refinement iteration 0
Marked for refinement due to surface intersection : 8820 cells.Determined cells to refine in = 3.87 sSelected for refinement : 8820 cells (out of 554112)Edge intersection testing:Number of edges : 1883850Number of edges to retest : 250376Number of intersected edges : 21198Refined mesh in = 1.77 sAfter refinement surface refinement iteration 0 : cells:615852 faces:1883850 points:652499Cells per refinement level:0 5452921 70560
Surface refinement iteration 1
Marked for refinement due to surface intersection : 38502 cells.Determined cells to refine in = 0.04 sSelected for refinement : 40392 cells (out of 615852)Edge intersection testing:Number of edges : 2787132Number of edges to retest : 1118049Number of intersected edges : 85655Refined mesh in = 3.17 sAfter refinement surface refinement iteration 1 : cells:898596 faces:2787132 points:990317Cells per refinement level:0 5432351 486812 306680
Surface refinement iteration 2
Marked for refinement due to surface intersection : 159213 cells.Determined cells to refine in = 0.1 sSelected for refinement : 168471 cells (out of 898596)Edge intersection testing:Number of edges : 6576117Number of edges to retest : 4737635Rhino Model and GH files is in t'he zip file.Please help me solve this question!~~…
the following image of a hut.
I do not have experience using kangaroo to simulate forces, but I have made a test using multiple random components on a flat surface to fake the effect I'm going for. See image below.
The main issue I'm having is that the original file used for my test surface used box morph and the variable pipe command. Box morph is a bit touchy on a curved surface and it is not as elegant as I would like it to be (ie. I want all the hair diameters to be perfectly circular and uniform in size). Variable pipe also does not align the base of the hair with the existing surface, which means I have to offset the surface and then trim the excess of my pipe.....leading to heavy code and the file crashing.
So I'm trying to rebuild the "hairs" using a new method:
1) Subdivide the surface
2) Find the midpoint of each surface and then create a straight line that is perpendicular
3) Move a point along the on the straight line (between the start and end points) in the z direction, and then create a nurbs curve using this point and the start and end points
4) create a circle at the base of each crv, and then two more circles: one at the point in the middle point (I think I set it to .9) and the end of the curve
5) The problem: Now I am trying to sweep along these three circles and the nurbs curve to create a bent hair/pipe that is flush with the conic surface, but it does not work.
If someone can help that would be amazing. I've included my original surface test file and my new file where I am rebuilding using the sweep command. Below is a drawing of what I'm trying to achieve.
…
s, the participants will focus on the key advantages of Grasshopper’s capabilities through a range of design challenges in order to aid designers in both their drafting tasks and modelling capabilities.
The workshop covers many concepts such as Object Attributes/Parameters, Data Types, Data Structures, and Designing with Algorithms. Specifically, this course will focus on understanding both Lists and Data Trees, as well as the best practices for integrating Grasshopper into your Professional Design Workflow. The workshop offers guided curriculum and continuous support, based on in-depth and professional learning experiences.
Workshop outcomes:Teach the participants how to:-
+ be proficient in parametric logics learning the key benefits of parametric techniques in architecture design workflow (when to use it & how to use it)+ Correctly communicate with different 3D and BIM packages in order to keep the geometry clean and light while preserving all NURBS information.+ Develop architecture design based on mathematical equations to create non-standard free form building skin.+ Create a pattern that changes dynamically based on specific inputs which can be applied over the building façade, interior walls or ceiling or even floor pattern.+ Automate and Optimize design variables to achieve the optimum solution for the design problem.
Program Outline:
DAY 1:-Introduction to Parametric Design -Introduction to Grasshopper & Rhino (technical tools).
DAY 2:-Exploring the parametric workflow. -Setup the design algorithm & generating a list of data.
DAY 3:-Introducing the new ways of generating parametric curves and surfaces.-Parametric form generation in-dept
DAY 4:-Introducing Data Tree logic and parametric transformations.-Creating Associative techniques – Attractors (points, curves and vectors).
DAY 5:-Working with advanced form generation with dynamic pattern.-Parametric optimization based on environmental analysis -featuring the Performance-Driven Design possibilities
DURATION:6 – 8 hours per day [50 - 60 hours Total]Every Saturday [9.00 Am : 1.00 Pm & 2.30 Pm : 6.00 Pm]
PREREQUISITES:No need of any specific knowledge of Rhinoceros or Grasshopper.
REGISTRATION:In order to register, you will need to fill the Registration Form .https://docs.google.com/forms/d/1PckdW1hrWs9fJAHWBZlVsuhH8K0PfDuMWIpXHT_4FYw/viewform
REGISTRATION DEADLINE:23th October 2014.…
Added by ayman wagdy at 7:48am on October 19, 2014
hops, design sessions & symposia across 5 cities in India. We encourage all architecture & design students and professionals to join us in this novel experimentation event and aid in 'Filling The Void'; Void in Architecture, Void in our Cities, Void in Education. REGISTRATIONS ARE OPEN NOW.
rat[LAB] Computational Design Tour - INDIA
Agenda // Filling The Void
1 country // 5 cities // 1 agenda // 100+ students // 25+ professionals // 5 exhibitions // 1 publication
Void is typically defined as null, invalid, empty or redundant and has a psychological perception of a ‘negative’. Through years of development in India, there has been an organic urban growth and inorganic architectural growth which has led to formation of voids in a physical and a metaphorical sense. There also exist voids as gaps between architecture, cities, education and technology. ‘Filling The Void’ looks at void as an opportunity, potential and a driver of change for architecture & design education in India.
// Cities & Dates*
Mumbai – 22nd June to 24th June 2015 (Monday to Wednesday)
Chennai - 29th June to 1st July 2015 (Monday to Wednesday)
Bengaluru – 3rd July to 5th July 2015 (Friday to Sunday)
Chandigarh - 16th July to 18th July 2015 (Thursday to Saturday)
New Delhi – 6th August to 8th August 2015 (Thursday to Saturday)
*Venue details are published on rat[LAB] website.
// Registration Dates
// Early-bird Registrations Open: 08 May 2015
// EXTENDED Early-bird registrations End: 05 June 2015
// General Registrations End: 15 June 2015 (Or till seats last)
…