Jump to content

how to merge intersection pt & inside of area pt


Recommended Posts

Posted (edited)

spacer.png

 

now I'm making a routine like wmfout basic command,

but I ran into a problem.

The blue color at the bottom of the above gif is shifted to the right because it comes from a part that is out of range.

 

I already know how to find a list of points inside an object boundary.

but I want to know how to merge it with its intersection into a list of points in the correct order.

Since polylines and splines cannot predict the number of points and can be intersections several times... 

so, I want the point list of the part highlighted in red in the picture below.

spacer.png

or

spacer.png

Thanks for reading.

Edited by exceed
Posted

Bpoly will do something close, to 1st image, note the single line sticking in will be ignored. The only way to make that work maybe is to make it a rectang with a width of 0.000000001 

 

image.png.5c33ecbd7ba57b55ab9d44fcd26f0a65.png

  • Like 1
  • 7 months later...
Posted
(defun c:XDTB_DWGCUT (/ dynpt e lastpnt myerr olderr pts ss ss1 tf)
  (defun _callback (dynpt)
    (xdrx_entity_move ss lastpnt dynpt)
    (setq lastpnt dynpt)
  )
  (defun _move (ss)
    (setq lastpnt (trans (xd::geom:get9pt ss 5)1 0))
    (xdrx_pointmonitor "_callback" ss)
    (initget 1)
    (getpoint (xdrx-string-multilanguage "\n插入点:""\nInsert Point:"))
    (xdrx_pointmonitor)
  )
  (defun myerr (msg)
    (princ "\n*cancel")
    (xdrx_end)
    (vl-cmdf ".undo" 1)
    (setq *error* olderr)
    (princ)
  )
  (xdrx_begin)
  (setq olderr *error*)
  (setq *error* myerr)
  (setq pts nil)
  (if (setq e (car (xdrx_entsel
                     (xdrx-string-multilanguage "\n请拾取裁剪边界<退出>:""\nPlease pick the cropping boundary <Exit>:")
                     '((0 . "lwpolyline,circle,ellipse,spline"))
                   )
              )
      )
    (progn (setq tf (xdrx-document-safezoom e))
           (setq pts (xdrx_getsamplept e)
                 ss  (ssget "cp" (xd::pnts:wcs2ucs pts))
           )
           (if (setq ss1 (xdrx_geom_clipboundary ss e t t))
             (progn (if tf
                      (xdrx_document_zoomprevious)
                    )
                    (ssadd e ss1)
                    (_move ss1)
             )
           )
    )
  )
  (setq *error* olderr)
  (xdrx_end)
  (princ)
)

 

[XDrX-PlugIn(83)] DWG cutting (theswamp.org)

https://www.theswamp.org/index.php?topic=59019.0

 

Rec0369.gif.17335cdc342afe654da6c57b2a346f4a.gif

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...