Author Topic: How to Entmake these 2 LWPOLYLINE?  (Read 4141 times)

0 Members and 1 Guest are viewing this topic.

HasanCAD

  • Swamp Rat
  • Posts: 1422
How to Entmake these 2 LWPOLYLINE?
« on: September 28, 2010, 11:50:22 AM »
I remeber that I had read that befoe but can not find.

Please help


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #1 on: September 28, 2010, 11:51:32 AM »
I remeber that I had read that befoe but can not find.

Do you have a cold? Mojo sent.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #2 on: September 28, 2010, 12:19:41 PM »
*rofl*
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ScottBolton

  • Guest
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #3 on: September 29, 2010, 02:37:21 AM »
Both lines from 0,10 > 0,0 > 10,0, the second with a 5.0 fillet - note the "bulge" on the second vertex (for some reason it's displayed here as a phone number - dunno how to stop it!).

(entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbPolyline")
      (90 . 3) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0)
      (10 0.0 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
      (10 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
      (10 10.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
      (210 0.0 0.0 1.0)
      )
    )
(entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbPolyline")
      (90 . 4) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0)
      (10 0.0 10.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
      (10 0.0 5.0) (40 . 0.0) (41 . 0.0) (42 . 0.414214); < this isn't a Skype number! ;
      (10 5.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
      (10 10.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0)
      (210 0.0 0.0 1.0)
      )
    )

If you are unsure how the (entmake should be made up, first create the element then issue (entget (car (entsel))) on it and look at the structure. (Similar for STYLES, etc.)

S

Daniel J. Ellis

  • Swamp Rat
  • Posts: 811
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #4 on: September 29, 2010, 03:57:27 AM »
The "strange" number of the bulge amount (DXF 42) clearly refers to the angle, somehow.

0.414214 is ten times the square root of two.  The cosine and sine of 45 degree is the inverse of root 2.

Forgotten too much of my A-Level Maths to turn that into anything useful, but that's wher ethe funny number comes from!

dJE
===
dJE

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #5 on: September 29, 2010, 04:39:22 AM »
The "strange" number of the bulge amount (DXF 42) clearly refers to the angle, somehow.

0.414214 is ten times the square root of two.  The cosine and sine of 45 degree is the inverse of root 2.

Forgotten too much of my A-Level Maths to turn that into anything useful, but that's wher ethe funny number comes from!

dJE

That means this number is fixed, Isn't it?

Daniel Eiszele

  • Newt
  • Posts: 85
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #6 on: September 29, 2010, 04:49:28 AM »
The bulge value is explained in many resources.  Here is one of them http://www.afralisp.net/archive/lisp/Bulges1.htm

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #7 on: September 29, 2010, 04:56:57 AM »
0.414214 is ten times the square root of two.

Not where I come from it isn't...

The Bulge is the tangent of a quarter of the included angle, positive for a bulge in the anticlockwise direction, negative otherwise.

Hence for a bulge as shown in your diagram:

Code: [Select]
Angle = pi/2
Direction = Anticlockwise

Bulge = tan (pi/8) = 0.41421 = (sqrt(2) - 1)

Or in code:

Code: [Select]
;; <angle>  -  +ve for anticlockwise, else negative.
(defun _GetBulge ( <angle> )  
  ((lambda ( a ) (if (equal 0.0 (cos a) 1e-14) nil (/ (sin a) (cos a)))) (/ <angle> 4.0))
)




JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: How to Entmake these 2 LWPOLYLINE?
« Reply #8 on: September 29, 2010, 10:39:09 AM »
0.414214 is ten times the square root of two.
Not where I come from it isn't...
...
*lol*
I would have also accepted: "Nope." or *blink-blink* or even *bleh*.

EDIT: Late entry:
"Did you find that information in the alt.swedish.chef.bork.bork.bork newsgroup" (or something similar).



Its just too bad that sarcasm is so difficult to convey properly without inflection.
« Last Edit: September 29, 2010, 10:44:58 AM by Se7en »
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org