Hi,
please anyone provide the logic of how to find overlapped length of two arcs ?
Check that the two Arcs [let's call them Arc1 and Arc2] share a common center point [DXF code 10 in entity data] and radius [DXF 40]. If they do [within tolerance], get the start points of both Arcs with (vlax-curve-getStartPoint).
If they overlap but their start points don't coincides, then only one of them will have its start point on the other. Use (vlax-curve-getClosestPointTo) with Arc1's start point to Arc2, and if the distance is 0 [within tolerance], that's the one; if not, find whether Arc2's start point is on Arc1. Let's say the one whose start point lies on the other is ArcA, and the other one is ArcB. Find where ArcB's endpoint is on ArcA, and get (vlax-curve-getDistAtPoint) on ArcA at that point.
I their start points coincide, find which one has its endpoint on the other, and just use the length of that shorter Arc.
@Kent1Cooper wrote:
If they overlap but their start points don't coincides, then only one of them will have its start point on the other.
@Kent1Cooper I think this assumes that the two arcs will have the same extrusion direction (DXF code 210) which may not be the case.
@leeminardi wrote:
.... I think this assumes that the two arcs will have the same extrusion direction (DXF code 210) which may not be the case.
True. Presumably, if they overlap [as I would interpret the word], they at least have either the same or exactly opposite extrusion directions, which wouldn't be difficult to check for along with center and radius. @jignesh.rana , is the possibility of opposite extrusion directions something that should be accounted for?
Opposite extrusion directions could result if the two arcs were drawn on coincident planes with their Z axes pointing in exactly opposite directions. Possible but unlikely. If the absolute value of the dot product of the two unit normal vectors were 1.0 (with tolerance) then the planes could be considered parallel.
Come to think of it, if either the start points or the end points coincide, or if one Arc has both its ends on the other Arc, all you need is to get their lengths and use the shorter one. Only if both extend beyond opposite ends of the other does it get more complicated.
round about way extrude the arcs, intersect command pick the surfaces, result is the overlapping section of the surface of which the lower edge is the overlap of the original arcs. explode the resulting surface and use the bottom most line as the solution.
yeah you are absolutely right but my case is both arc are in opposite direction and some middle portion of those two arcs are overlapped and i want that overlaped length
@jignesh.rana wrote:
.... both arc are in opposite direction and some middle portion of those two arcs are overlapped and i want that overlaped length
Overlapping Arcs cannot be "in opposite direction" unless one is drawn from "below." Regardless of how you draw an Arc, AutoCAD stores information about it running the the CCW direction. So if they're in the same plane, the process described in Message 2 will give you the overlapping length. Are you capable of working that out?
how to find in front face of entity from another entity ?
means suppose i have two lines and both are parallel then i can do it but if it is not parallel then how to find
I've been playing with a routine to calculate the overlap length of two Arcs, trying to account for all possibilities [other than opposite extrusion directions], and I think it's finished [attached].
Congratulations, it works excellent and maybe I can use this one day and I appreciate it..
Thanks for sharing.
Sebastian
first of all thanx a lot
but sir i need code in vc++ so any one convert it in vc++ and will post it soon ?
Can't find what you're looking for? Ask the community or share your knowledge.