Yesterday, I discussed with my friends on the forum the problem of xdrx-curve-getsplitcurves interrupting ultra-short-term lines. I felt that it was suitable for the following, so I wrote it.
xdrx-curve-getsplitcurves is not used here, but
xdrx-curve-intersectbreak is used
![](http://www.theswamp.org/index.php?action=dlattach;topic=58789.0;attach=41613;image)
After bidirectional offset, all intersection points are interrupted, and then a tolerance "_shortlen" is defined. Anything less than this is deleted, and the short lines at the lower intersection corners are cleaned up.
(defun _delete
-shortlen
(ss
) (if (< (xdrx
-getpropertyvalue x
"length") _shortlen
) (xdrx-entity-delete x)
)
)
(xdrx-pickset->ents ss)
)
)
(setq _shortlen
10.0);;define shortlen length "\nSelect a double-line curve <Exit>:"
'((0 . "line,*polyline,arc"))
)
)
)
(xdrx-begin)
(xdrx-setmark)
;; Mark the newly generated entity
(xdrx-curve-offset x (/ wid 2.0))
(xdrx-curve-offset x (- (/ wid 2.0)))
)
(xdrx-pickset->ents ss)
)
;;The newly generated entity after getting the mark
(xdrx-setproperty ss1 "color" 7)
(setq ss2
(xdrx
-curve
-intersectbreak ss1
)) ;;All curves in the selection set are interrupted at the intersection points
(_delete-shortlen ss2)
(xdrx-end)
)
)
)