Populating a surface - Grasshopper2024-03-28T16:25:11Zhttps://www.grasshopper3d.com/forum/topics/populating-a-surface?xg_source=activity&feed=yes&xn_auth=noNo, mine is bigger! er... I…tag:www.grasshopper3d.com,2013-03-30:2985220:Comment:8205352013-03-30T19:06:54.962ZVicente Solerhttps://www.grasshopper3d.com/profile/VicenteSoler
<p>No, mine is bigger! er... I mean... faster!</p>
<p>If you take into account the time it takes to think about shaving off a few unnoticeable ms by not using the expression component mine is faster :D</p>
<p> </p>
<p>He was complaining about complexity, not speed.</p>
<p>The method I posted was simpler than the one you suggested and still fast (no noticeable difference). With the added benefit that you can ignore the area component if you want making it even simpler (and also faster).</p>
<p>No, mine is bigger! er... I mean... faster!</p>
<p>If you take into account the time it takes to think about shaving off a few unnoticeable ms by not using the expression component mine is faster :D</p>
<p> </p>
<p>He was complaining about complexity, not speed.</p>
<p>The method I posted was simpler than the one you suggested and still fast (no noticeable difference). With the added benefit that you can ignore the area component if you want making it even simpler (and also faster).</p> Actually, for any 4 point sur…tag:www.grasshopper3d.com,2013-03-30:2985220:Comment:8204382013-03-30T18:19:54.285ZHannes Löschkehttps://www.grasshopper3d.com/profile/HannesLoeschke
<p>Actually, for any 4 point surface, the midpoint of a diagonal is an approximation of the center point. For flat surfaces, it will be exact.</p>
<p></p>
<p>But since the area center returns the center of gravity, this point will most likely be above or below the surface for any curved surace anyway.</p>
<p></p>
<p>If you are aiming for speed, avoid the function evaluator. For most cases, parsing the expression takes longer to solve than five or six individual math components. This is…</p>
<p>Actually, for any 4 point surface, the midpoint of a diagonal is an approximation of the center point. For flat surfaces, it will be exact.</p>
<p></p>
<p>But since the area center returns the center of gravity, this point will most likely be above or below the surface for any curved surace anyway.</p>
<p></p>
<p>If you are aiming for speed, avoid the function evaluator. For most cases, parsing the expression takes longer to solve than five or six individual math components. This is especially true for functions that are already implemented in a separate component, such as average. Even with this, Vicente's approach takes about twice as long as in the exam part than mine. ;) As always it's speed vs. accuracy.</p> True true :)tag:www.grasshopper3d.com,2013-03-30:2985220:Comment:8206102013-03-30T12:02:34.021ZDieckerhttps://www.grasshopper3d.com/profile/Diecker
<p>True true :)</p>
<p>True true :)</p> You can still use it to get t…tag:www.grasshopper3d.com,2013-03-30:2985220:Comment:8204192013-03-30T11:54:16.970ZVicente Solerhttps://www.grasshopper3d.com/profile/VicenteSoler
<p>You can still use it to get the vector perpendicular to the cells.</p>
<p>You can still use it to get the vector perpendicular to the cells.</p> Hey Vincente,
Thanks for you…tag:www.grasshopper3d.com,2013-03-30:2985220:Comment:8202752013-03-30T02:35:17.313ZDieckerhttps://www.grasshopper3d.com/profile/Diecker
<p>Hey Vincente,</p>
<p></p>
<p>Thanks for your time and feedback as well. I believe the people that grade me expect me to use the Area component (when given). It' s a nice method indeed that will come handy during my journey.</p>
<p>Hey Vincente,</p>
<p></p>
<p>Thanks for your time and feedback as well. I believe the people that grade me expect me to use the Area component (when given). It' s a nice method indeed that will come handy during my journey.</p> Then try this method, it's fa…tag:www.grasshopper3d.com,2013-03-30:2985220:Comment:8200892013-03-30T00:09:27.734ZVicente Solerhttps://www.grasshopper3d.com/profile/VicenteSoler
<p>Then try this method, it's fast and simpler. It won't calculate the normal at the exact exact centroid of each cell if the surface has really weird UVs but it should be good enough for 99.9% of cases.</p>
<p>It also gives you the center point directly so no need to use the computationally expensive area component.</p>
<p>Then try this method, it's fast and simpler. It won't calculate the normal at the exact exact centroid of each cell if the surface has really weird UVs but it should be good enough for 99.9% of cases.</p>
<p>It also gives you the center point directly so no need to use the computationally expensive area component.</p> The two vectors with the cros…tag:www.grasshopper3d.com,2013-03-29:2985220:Comment:8203562013-03-29T23:57:55.632ZDieckerhttps://www.grasshopper3d.com/profile/Diecker
<p>The two vectors with the cross product is indeed way advanced for my course. However it is way faster as well. But since your method used and didn't change the given starting point, I believe i'm aloud to use it :)</p>
<p>The two vectors with the cross product is indeed way advanced for my course. However it is way faster as well. But since your method used and didn't change the given starting point, I believe i'm aloud to use it :)</p> Okay, so if you would want to…tag:www.grasshopper3d.com,2013-03-29:2985220:Comment:8201322013-03-29T20:58:06.960ZHannes Löschkehttps://www.grasshopper3d.com/profile/HannesLoeschke
<p>Okay, so if you would want to impress your professor, here's the clever endpoint... well there are some that might not take lightly to showing them a more clever solution, so impress at your own risk ;)</p>
<p>Okay, so if you would want to impress your professor, here's the clever endpoint... well there are some that might not take lightly to showing them a more clever solution, so impress at your own risk ;)</p> Hey Hannes,
Thanks for the w…tag:www.grasshopper3d.com,2013-03-29:2985220:Comment:8202372013-03-29T20:45:39.850ZDieckerhttps://www.grasshopper3d.com/profile/Diecker
<p>Hey Hannes,</p>
<p></p>
<p>Thanks for the walkthrough! Solved the whole assignment immediately lol. Haven't encountered the remapping function yet so your introduction to it was really helpfull!</p>
<p>Hey Hannes,</p>
<p></p>
<p>Thanks for the walkthrough! Solved the whole assignment immediately lol. Haven't encountered the remapping function yet so your introduction to it was really helpfull!</p> Ok, I could post and endpoint…tag:www.grasshopper3d.com,2013-03-29:2985220:Comment:8202342013-03-29T20:21:04.647ZHannes Löschkehttps://www.grasshopper3d.com/profile/HannesLoeschke
<p>Ok, I could post and endpoint.gh, but since you're trying to prepare for an exam, I'll just explain my way.</p>
<p>You have a distance measure and the domain (min and max) of the possible values. Since those are your input values for the height, you need to <strong>remap</strong> them from the source domain to a target domain from 1 to 5. As you want the maximum height mapped to the minimum distance, you actually need to remap to "5 to 1".</p>
<p>Now you need to <strong>move</strong> the…</p>
<p>Ok, I could post and endpoint.gh, but since you're trying to prepare for an exam, I'll just explain my way.</p>
<p>You have a distance measure and the domain (min and max) of the possible values. Since those are your input values for the height, you need to <strong>remap</strong> them from the source domain to a target domain from 1 to 5. As you want the maximum height mapped to the minimum distance, you actually need to remap to "5 to 1".</p>
<p>Now you need to <strong>move</strong> the center points perpendicular to the surface. The <strong>normal</strong> vector of a surface is always perpendicular at the point. You can <strong>evaluate</strong> the surface to get those vectors. Problem is, evaluate needs a UV coordinate as input and you only have the 3D coordinates of the center points. Finding the <strong>closest point</strong> to a surface will return the CP in 3D space but fortunately also the UV coordinates along the surface.</p>
<p>All you need to do is connect the moved center points to the lines.</p>
<p></p>
<p>On a side note: All the surface components produce a lot of overhead. If the surface is flat or you can live with an approximation, you can get the normals from the corner points of the subsurface. Create two vectors across the diagonals and calculate the cross product. The resulting vector will be perpendicular to both input vectors... and take a lot less time and ressources to calculate ;)</p>