Ambrosia Garden Archive
    • @crono, on Feb 28 2007, 11:34 AM, said in SketchMapMerge Shapes:

      Regardless of how you do it, what you get out at the end though will be pretty useless with regards to a SFA wall though for obvious reasons.

      But anyways, I think I've said my fill here - I'll let cheleball clarify what he was actually after.

      Oh-ho, we're talking practicality now, eh? In that case, yeah, I admit this is kind of useless. I was mostly just after an interesting problem, but it's proving more and more intractable as time goes on. (Although, just between you and me, I think this could turn into a fantastic tool for mapmaking once the methods are developed enough. That more than anything is what I'm going for here.)

      As for the rest--I opted for the brute force method because the cartesian versions of the formula produced by eliminating the parameter are just a mess, and I figured it would be easier to work with. And it does work--for the offsets. But the angles of rotation are off, and I don't understand how that could be so because, as far as I can tell, my method is mathematically sound.

      The "repeating a shape along a path" approach is what I initially thought I would use, but when I started thinking about how to actually implement it, the only way I could see to do it involved calculating the path anyway. And if you're going to do that...just use the brute force method.

      I must admit, Crono, that I'm feeling a little over my head. It seems that you expect me to make some sort of connection between what you've written and how to implement a cycloid with proper rotation angles, but it's not at all obvious to me how to do so. I may not have enough linear algebra and/or software engineering experience, or something.

      In any case, don't worry about it. I think I'll move on to constructs that have a bit more utility in mapmaking.

    • @cheleball, on Feb 28 2007, 11:09 PM, said in SketchMapMerge Shapes:

      Oh-ho, we're talking practicality now, eh? In that case, yeah, I admit this is kind of useless. I was mostly just after an interesting problem, but it's proving more and more intractable as time goes on. (Although, just between you and me, I think this could turn into a fantastic tool for mapmaking once the methods are developed enough. That more than anything is what I'm going for here.)

      As for the rest--I opted for the brute force method because the cartesian versions of the formula produced by eliminating the parameter are just a mess, and I figured it would be easier to work with. And it does work--for the offsets. But the angles of rotation are off, and I don't understand how that could be so because, as far as I can tell, my method is mathematically sound.

      The "repeating a shape along a path" approach is what I initially thought I would use, but when I started thinking about how to actually implement it, the only way I could see to do it involved calculating the path anyway. And if you're going to do that...just use the brute force method.

      I must admit, Crono, that I'm feeling a little over my head. It seems that you expect me to make some sort of connection between what you've written and how to implement a cycloid with proper rotation angles, but it's not at all obvious to me how to do so. I may not have enough linear algebra and/or software engineering experience, or something.

      In any case, don't worry about it. I think I'll move on to constructs that have a bit more utility in mapmaking.

      lol - I was always talking 'practically' otherwise I wouldn't have suggested the other methods, but no worries. In that case ZP is absolutely right, but that's what comes of me not reading posts properly and trying to reply quickly before/during work. 😉

      Regarding the angles, if you think back to the single circle you started this post with, you will probably notice that your walls are placed tangentially to the curve in all places. So the angle you place your piece at is actually the gradient of the curve at the place you put it -= a.k.a the value of its first order derivative at that point. (which is why I was banging on about gradients etc).

      Also, I wouldn't call mapping ths shape properly easy at all, but there again, my maths is pretty rusty to be honest - it's been at least seven years since I last looked a parametric equation and derivatives thereof 😉

      Maybe, if I'm (very) bored one weekend, I might sit down and try writing something to do it, purely because it has been so long and I'd like to dabble in a bit of applied pure maths again. Yeah, sad, I know 😉

      Well off-topic, but thinking of compsci/mathmo jokes, have you ever visited xkcd.com?

      a few of my recent favourites (You have to hold the mouse over the image for the 'alt' text for some of the punch-lines)
      http://xkcd.com/c217.html
      http://xkcd.com/c221.html
      http://xkcd.com/c228.html

    • DDDUUUuuuhhhrr. I am SUCH an IDIOT.

      When I decided how best to calculate the rotation angle, I ruled out using the gradient because I thought it was redundant. Each wall IS a tangent line, and since my brute-force method gives me the endpoints of each segment, I could get the slope (and thus, the angle) from them. However, I neglected the part where each wall starts life with its CENTER at the origin (it has to for SMM rotation to work correctly), and since the repositioning is offset-based, each segment winds up with its center at the calculated point. So, my points give the line connecting center to center, not end to end. Of course the angles were wrong. Sheesh.

      So, I wound up using the gradient after all, and my cycloid is now (nearly) perfect. I've corrected in my code so that the bottom-right of the first wall is at the origin, but the cusps have issues. To get it right, you'd have to use the arc length formula to determine the length between cusps and size your walls accordingly, but then you'd still have problems because the algorithm relies on linear distance rather than arc length, which only works if the curve doesn't change concavity.

      So the cusps need some manual adjustment, but the cycloid is otherwise perfect.

      Check goes the box next to "problem solved." Now I can finally sleep at night. 😄

      @crono, on Feb 28 2007, 04:58 PM, said in SketchMapMerge Shapes:

      Well off-topic, but thinking of compsci/mathmo jokes, have you ever visited xkcd.com?

      a few of my recent favourites (You have to hold the mouse over the image for the 'alt' text for some of the punch-lines)
      http://xkcd.com/c217.html
      http://xkcd.com/c221.html
      http://xkcd.com/c228.html

      Heh, I don't think I'm enough of a math nerd to really appreciate that strip, although I did get a chuckle from those three.

      Attached File(s)