Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

find overlaped length

13 REPLIES 13
Reply
Message 1 of 14
jignesh.rana
560 Views, 13 Replies

find overlaped length

Hi,

 

              please anyone provide the logic of how to find overlapped length of two arcs ?

13 REPLIES 13
Message 2 of 14
Kent1Cooper
in reply to: jignesh.rana

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.

Kent Cooper, AIA
Message 3 of 14
leeminardi
in reply to: Kent1Cooper

 


@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.

lee.minardi
Message 4 of 14
Kent1Cooper
in reply to: leeminardi


@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?

Kent Cooper, AIA
Message 5 of 14
leeminardi
in reply to: Kent1Cooper

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.  

lee.minardi
Message 6 of 14
Kent1Cooper
in reply to: Kent1Cooper

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.

Kent Cooper, AIA
Message 7 of 14
parkr4st
in reply to: Kent1Cooper

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.

Message 8 of 14
jignesh.rana
in reply to: Kent1Cooper

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

Message 9 of 14
Kent1Cooper
in reply to: jignesh.rana


@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?

Kent Cooper, AIA
Message 10 of 14
jignesh.rana
in reply to: Kent1Cooper

 no sir please provide the code how to find overlaped length of two arcs 

Message 11 of 14
jignesh.rana
in reply to: jignesh.rana

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 

 

 

Message 12 of 14
Kent1Cooper
in reply to: jignesh.rana

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].

Kent Cooper, AIA
Message 13 of 14
cadffm
in reply to: jignesh.rana

@Kent1Cooper 

Congratulations, it works excellent and maybe I can use this one day and I appreciate it..

Thanks for sharing.

 

 

 

Sebastian

EESignature

Message 14 of 14
jignesh.rana
in reply to: Kent1Cooper

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.

Post to forums  

Forma Design Contest


AutoCAD Beta