From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-29-2019 06:40 AM
I am working with 1 array. That array will create a shape and I display it in 1 graph. I want extend shape according to a range that you have set up. The file below is the code I tried to do.
Please help me solve this problem. Thank
Solved! Go to Solution.
08-29-2019 07:25 AM
This isn't really a LabVIEW problem. This is a math/geometry problem.
How would you solve the problem numerically if you were doing this on pencil and paper?
08-29-2019 10:58 AM - edited 08-29-2019 11:04 AM
just an idea:
08-29-2019 11:33 AM
It is also what I mean. But i want its output to also be an array (shown on the graph) with a larger size. I want the distance from each side to be equal. can you help me
08-29-2019 11:53 AM
This is how I deal on paper. "a" is the value you want to set the width is how much? but I don't know how to handle an array with lots of values in it and when when it is a polygon
08-29-2019 12:09 PM - edited 08-29-2019 12:14 PM
Array with lots of values, you handle with a loop.
Your hand sketch is too simple as it only shows a rectangle that is parallel to the axes. Your code shows something with a triangular shape. I assume you want an angled side to also be offset by ""a"? In which case you can't just add "a" to the x and y coordinates.
As I said, this is a math problem, and you have worked out the math yet. Have you googled this yet? https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-bufferin...
I think for each "side", you want to find the vector that is normal to that side (and you have to know whether which direction that vector is pointing, probably knowing what point is inside the shape), and adding a cos theta to the x coordinates, and a sin theta to the y coordinates of the two points that define that side where theta is the angle of that vector relative to the X axis.
Once you do that for all sides, then you'll find out you'll have an exploded version of your original shape, but none of the points match. You'll have to go through the points again and create new endpoints based on where the adjacent sides would intersect.
Solve this on paper in a flow chart. Then it will be easy to transfer to LabVIEW code!
08-29-2019 12:52 PM
@Vu_Anh wrote:
This is how I deal on paper. "a" is the value you want to set the width is how much? but I don't know how to handle an array with lots of values in it and when when it is a polygon
You need to be careful, because even if the spacing of the parallel segments is "a", the distance of the corner point pairs might be srqt(2)*a, so you need to decide who is supposed to "win". In the more general case, you also need to deal with segments that are convex or at arbitrary angles and local curvatures.
What precision do you need? For example are you trying to find the walls generated if you move a mill bit of a given diameter (a) along the original path? Something else?
08-29-2019 08:55 PM
yeah. i am trying to find the walls generated if you move a mill bit of a given diameter (a) along the original path and i want its output to also be an array (shown on the graph) with size "a + original path"
08-30-2019 04:14 AM
@RavensFan wrote:
As I said, this is a math problem, and you have worked out the math yet. Have you googled this yet? https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-bufferin...
kudos for this hyperlink!
08-30-2019 07:49 AM
I can do it your way. thank you very much.