Jump to content

Recommended Posts

Posted
from pyrx import Rx, Ge, Gi, Db, Ap, Ed
import traceback
from shapely import Polygon


@Ap.Command()
def doit():
    try:
        db = Db.curDb()

        desc = Db.Polyline.desc()
        ps, id1, _ = Ed.Editor.entSel("\nPline1 :", desc)
        ps, id2, _ = Ed.Editor.entSel("\nPline2 :", desc)

        pline1 = Db.Polyline(id1)
        pline2 = Db.Polyline(id2)

        polygon1 = Polygon(pline1.toList())
        polygon2 = Polygon(pline2.toList())

        res = polygon1.intersection(polygon2)

        pl3 = Db.Polyline(list(res.exterior.coords))
        pl3.setColorIndex(1)
        db.addToModelspace(pl3)

        print(res.area, pl3.getArea())

    except Exception as err:
        traceback.print_exception(err)

 

shapley.png.75b8209ed827ab665b81d21468daa524.png

  • Like 1
Posted

no bulges though

Posted (edited)

Not sure how this compares to Bpoly, pick point, then use entlast. I can see do multiple objects in one go though.

Edited by BIGAL
Posted
12 minutes ago, BIGAL said:

Not sure how this compares to Bpoly, pick point, then use entlast. I can see do multiple objects in one go though.

It’s just another tool in the toolbox, right? acedTraceBoundary is a good option too

  • Like 1
Posted (edited)

I can see from the images the functions would be very handy at times. Often need to go to a mathematical solution to get a formula and hopefully some one has done that formula in say Lisp or Python.

 

Have you thought about putting together a Word doc with your "Tools" no code just images etc and what they do. I have one for my lisps, it was created for the staff where I used to work.35 pages,  around 3 lisps per page, keep adding and updating the file, something I need to do. The tools your providing are very useful.

image.png.d41eae1b8639faa70caaf37dc15b50f7.png

Edited by BIGAL

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