@john.uhden wrote:
@leeminardi ,
That graphic you made is very revealing. Maybe it will help me to learn.
BUT, my main concern/question remains how can you find where a 20% slope is headed when the 3Dface (plane) is at a slope of say 10%?!
@john.uhden
If the slope of a 3dface is 10% there is no direction you can go on that 3dface where the slope will be 20%. The task is to find a less steep slope on a more steep sloped hill. E.g., find a direction on a 20% sloped incline that has a 10% slope.
I tried to explains how I do it in my post #53.
First I find the slope of the 3dface. I named it slopeVector. You've implied that vectors freak you out but they are not that complex and a spatial guy like you should like them. Consider SlopeVector to be a arrow pointing uphill with the same slope as the hill. The desired slope that we want to find is DesignSlope and can be show as another arrow (although as specified, it's a scalar)! We can define this arrow (vector) as being below the SlopeVector. Note, (and this may be a source for confusion) DesignSlope in the drawing below implies a vector but in my code it is a scalar (e.g., 0.0 for a 20% slope). Its rise/run is equal to the user specified design slope. But, as drawn, the DesignSlope arrow is below the surface of the hill (3dface). That is, its not as steep as the slope of the hill. We want to rotate this vector about the world Z axis such that it becomes flush wth the 3dface. I named this angle gamma and derived the following expression for gamma:
gamma = acos ( (design_slope) / (slope_of_the_3DFace))
where:
design_slope = user specifed
slope_of_the_3DFace = ( z coordinate of the slope vector) /
(the length of the slope vector projected to the XY plane)
Let me know if you'd like an explanation of the derivation of gamma.
There are two possible solutions for the direction of the less steep path up the hill. One is pointing uphill to the left of going straight up the hill (the direction of slopeVector) and the other pointing to the right of going straight up the hill.
Here are top views looking down at the 3dface showing plu and minus values for gamma. The "Q" points show potential exit points from the 3dface at the design slope.
Please review the latest revision of the code in post #63 and don't hesitate to ask if you have more questions .
Lee
lee.minardi