Grasshopper

algorithmic modeling for Rhino

Surface Attractor extrusion direction dependent on Curve location

Hello, 

I am puzzled by this. As can be seen in my plan view image, I have a wall that I am using an attractor curve to extrude based on the distance from the surface. This works great on one side. For instance when I have the curve further away from the surface it adjusts beautifully, and when close there is no extrusion. What I want is to be able to have the surface extrude in the other direction when the curve is oriented on the other side of the surface. (this can be seen in the plan). 

I though it should be the negative domain to its absolute value; however, this is not the answer. 

Any suggestions would be greatly appreciated!

Thank you, 

Erik

Views: 714

Attachments:

Replies to This Discussion

Hmm ... there's something MIA here: maybe some dot thingy? maybe something else? ...he he.

I just recalled that I have a collection of defs that do that. Most are in the ... er ... well ... known "format" - but knowing you ... well ... you are in the path (to the Dark Side) , aren't you? he he. In fact I have exactly what you want but it's one C# and no components at all (maybe too much).

So ... get this that is rather more "palatable"  (it works with point attractors: as many as you like) and allow me a couple of minutes to add the curve (or any curve collection) as plan B.

Unless of course some good Samaritan ... blah, blah

Attachments:

Ahh nice! Thanks Peter your solution works great and works for curves just fine. Just divide and use the pts as inputs. Looks great!

I have also found a 'sort of' solution I think I a solution by remapping the negative value domain into the positive remapped domain. There is probably a more elegant way of doing this, but I have to try it on my original definition since this one is greatly simplified. 

Attachments:

The secret is in the dot product: where the first vector is the surf normal at a given Point[Y] (to be altered, that is) and the other is the attractorPoint[x] -  Point[Y].

 public double DotProduct(Vector3d v1, Vector3d v2){
    double dot = (v1.X * v2.X) + (v1.Y * v2.Y) + (v1.Z * v2.Z);
    return dot;
  }

If this is negative it means that the 2 vectors point east-west (meaning that, say, the distance should being multiplied by -1).

I haven't found the time to do the V2 promised ... but it's w/e on sight thus expect it rather soon (it would deliver "some" other things that I have in mind as well, he he)

Sorry for the late reply, but I appreciate the dot product tip. It is immensely powerful.

Notify if you still need that V2 promised (but the w/e was MotoGP w/e (Valentino almost did it) AND Formula1 w/e (Lewis delivered)).

BTW: Although this is code (from V2) .... but since you can read it easily here's another tip:

meaning: you can use exp (or log or some Gauss or whatever) as options for calculating distances (remap takes care of all anyway) if you want a more "drastic" drop/increase in the vector lengths with regard the affected control points.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service