#robotics Logs
Sep 17 2017
#robotics Calendar
05:17 AM jason_ is now known as Guest67243
01:16 PM squirrel1 is now known as veverak
03:23 PM rue_house: huh, doing a sphere/plane intersection is really easy
03:24 PM deshipu: yeah, it's always a circle
03:24 PM veverak: yup
03:24 PM deshipu: not like cone/plane
03:28 PM rue_house: anyone know why the CSG used in openscad is so horridly slow when its all polygonized anyhow?
03:31 PM rue_house: hmm, never thought to express a line segment as a centre point, radius and angle
03:35 PM deshipu: now you know :D
03:39 PM rue_house: so, I want to put my brain back on how to locate the closest point on a line to a point
03:39 PM veverak: did that a while ago
03:40 PM rue_house: yea, I was interested, but didn't have time
03:40 PM rue_house: oh
03:41 PM veverak: I used the fact that dot product of perpendicular vectors is 0
03:42 PM veverak: and that the point are searching makes vector with point that is not on the line
03:42 PM veverak: and entire thing was using parametric line definition
03:42 PM veverak: p = A + tB
03:42 PM veverak: you just search for 't', so the dot product is 0
03:43 PM veverak: but, code I found on the internetz used different method
03:43 PM rue_house: rotate the line 90 degrees and change the offset to go thru the dot
03:43 PM veverak: sounds ok
03:45 PM rue_house: then find the intersection of the two
03:45 PM rue_house: no searching
03:45 PM synja: why the CSG used in openscad is so horridly slow when its all polygonized anyhow?
03:45 PM alic1a: synja: Jan 1, 2013 - OpenSCAD uses CGAL's CSG operations on Nef polyhedrons, not the brep functionality. . CGAL indeed has slow speed while processing the complex models such as . So I guess the only options are optimizations in libCGAL (which . You can't see the preview, nor can you really use the program at all. I find that it is not usable.
03:46 PM synja: rue_house
08:19 PM rue_shop3: ok I'm out of visitors
08:19 PM rue_shop3: now, take a line...
08:19 PM veverak: :D
08:20 PM veverak: I hate games
08:20 PM veverak: they make me play them
08:22 PM rue_shop3: A*x + B*y = C
08:22 PM rue_shop3: so, the idea is to keep the slope the same, but to make it go thru a given point
08:22 PM rue_shop3: A and B are slope
08:22 PM rue_shop3: so you just need to change C
08:23 PM rue_shop3: oh god, thats easy isn't it
08:24 PM rue_shop3: just put the point in for x and y and it gives you the new C
08:24 PM rue_shop3: then the line has the same slope, but goes thru the point
08:24 PM rue_shop3: this is easy
08:25 PM rue_shop3: hmm, much harder is what to call this function
08:26 PM rue_shop3: double minDistPiontLine(point2d_t this, line2d_t that) {
08:27 PM rue_shop3: line2d_t intersector;
08:27 PM rue_shop3: lineCopy( &intersector, that);
08:28 PM rue_shop3: rotateLineZ( &intersector, 90);
08:28 PM rue_shop3: lineGF_t solver;
08:28 PM rue_shop3: line2General(&solver, intersector);
08:29 PM rue_shop3: solver.C = solver.A * this.x + solver.B * this.Y;
08:30 PM rue_shop3: hmm, where is the fn to take a general form line and convert it into a segment....,.. uh... I dont have one...
08:30 PM rue_shop3: but irony the line intersection code converts both its segment inputs
08:31 PM rue_shop3: ok screw it
08:31 PM rue_shop3: lineGF_t origLine;
08:31 PM rue_shop3: line2General(&origLine, that)
08:31 PM rue_shop3: ;
08:32 PM rue_shop3: .... and I'm gonna break out my intersection so I can feed it the general form lines
08:32 PM rue_shop3: getIntersectionGeneral(point...
08:32 PM rue_shop3: wait I forgot the goal, I should be reutnring the point, not he distance
08:33 PM rue_shop3: point2d_t result = getIntersectionGeneral( &result, solver, origLine);
08:34 PM rue_shop3: return result;
08:34 PM rue_shop3: }
08:34 PM rue_shop3: ok, bit of cleaning and its good
08:34 PM rue_shop3: look like only 2 trig ops
09:11 PM rue_house: http://paste.debian.net/986580/
09:11 PM rue_house: there we have it
09:12 PM rue_house: veverak, do you have some sample data?
09:12 PM veverak: not really
09:13 PM veverak: rue_house: I dropped it because it was overkill
09:13 PM veverak: for the problem
09:21 PM rue_house: bah, so you dont have any test data?
09:21 PM veverak: nope
09:23 PM rue_house: I'll stuff one test case in, and if it works, I'll just call the whole thing good
09:26 PM rue_house: point at 82.25,39.25
09:27 PM rue_house: line from 66.25,142.25 to 131.25,14.25
09:28 PM rue_house: answer should be...
09:39 PM Tom_itx: makin up for lots interweb time?
09:41 PM rue_house: the intersection (took a while, this new ver of librecad SUCKS) is 111.112,53.9065
09:41 PM rue_house: no it wasn't
09:42 PM Tom_itx: you left out z
10:35 PM rue_house: there was a car accidnet just a half block u the road!
10:35 PM rue_house: just sounded like a thump
10:35 PM rue_house: didn't realize
10:36 PM rue_shop3: damn its sunday
10:45 PM rue_house: oh I rotated the line around 0,0
10:46 PM rue_house: no, that shouldn't matter
10:54 PM Tom_itx: kinda remote for cars to accident ehh?
10:54 PM rue_house: aha, I forgot to move the solver
10:55 PM rue_house: YE!
10:55 PM rue_house: YES! (and I need a new keyboard...)
10:55 PM Tom_itx: mine have keys that stick too
10:56 PM rue_house: http://paste.debian.net/986586/
10:56 PM rue_house: and thats the working function,
10:56 PM rue_house: thats the closest point along the line to the given point
10:56 PM rue_house: veverak, ?
10:57 PM rue_house: from there, you can get the distance between the points
10:58 PM rue_house: cool, today I compounded the mess of my 2d library
10:58 PM rue_house: its 405 lines now...
11:00 PM rue_house: yes, the only trig is in rotating the line
11:00 PM rue_house: I'm trying to think of how to turn the general form of a line back into a segment
11:00 PM rue_house: one would have to specify the position and length again
11:00 PM rue_house: not sure how that could be phrased
11:34 PM rue_house: ok, hmm, I wonder what other functions are good to have
11:34 PM rue_house: I wonder how I could make a parallel line a set distance from another line
11:35 PM rue_house: suppose I'd want the reverse of that last function
11:38 PM rue_shop3: ok, well, I suppose I'll start packing up
11:40 PM rue_shop3: Tom_itx, have you ever tightened up the sliders on your sherline?