Jump to content

Lisp create perspective view from a 2D drawing


LINHOREKA

Recommended Posts

Hi, this lisp is working in 2D only: it generate a perspective view from a selected 2D plan or elevation.

 

1. Command: P2D

2. Select the source frame (trapezoid polyline) of the plan or elevation

3. Select drawing objects in that source plan or elevation

4. Select destination frame >>> a new perspective drawing would be draw arcordingly (see image and example drawing)

5. Repeat step 4 until you select none

 

It is working only with straight lines, straight polylines and points. Pretty useful when you want to take a leap up from your 2D, for but donot have time to create a 3D model.

 

New version on Apps Exchange Store, extrusion enabled

P2D EXAMPLE.dwg

P2D.jpg

P2D command.LSP

Edited by LINHOREKA
Update link of new version
  • Like 1
Link to comment
Share on other sites

Wow, with Sean Tessier, we can make 3D street art !

There is another kind of simple perspective 2D like this: A profile + 1 vanishing point = This image (from CAD APLUS)

Pers from 1 vanishing point.jpg

Edited by LINHOREKA
Link to comment
Share on other sites

No, it works only with elementary objects of straight lines and polylines. Try lisp suggested by Lee Mac, works with curves, hatches. But no block avaiable neither !

I found my lisp has an advantage: it can transform from any trapezoid frames to any others.

I test to make 3D street arts and here it is:

1. If objects lay inside the frame polylines, it is ok

2. If objects lay outside, it fails (not yet understand why :unsure:)

Anyway, it is interesting. Someday I would upgrade it to work with all objects, and correct this trouble.

P2D TEST 1.jpg

P2P TEST 2.jpg

P2D EXAMPLE.dwg

Link to comment
Share on other sites

Ah, i work it out: the objects cannot go too high over the horizontal sky line !

Here is another example shows how it work well enough:

It implies 3D street art need alot of area if draw objects extrude up, but less area if draw objects extrude down ! That is why valley is prefered, while moutains is not :lol:

P2D TEST 3.jpg

Link to comment
Share on other sites

Hey guys, thanks for the mention. Perspective transform is an interesting field.

 

From what I can see, LINHOREKA, we both used a similar process, as did maicy in the links below. The alternative is straight matrix manipulation as demoed by SOFITO_SOFT and Kean (Through the Interface).

 

The links here show some interesting variations on the theme. Those for theswamp.org will require registration. It is such a good site, though, any AutoCAD developer would be happy they made the effort.

 

http://www.theswamp.org/index.php?topic=36905.0

http://www.theswamp.org/index.php?topic=37183.0

 

http://through-the-interface.typepad.com/through_the_interface/2013/08/applications-for-linear-algebra-straightening-out-perspective.html

http://through-the-interface.typepad.com/through_the_interface/2013/08/update-on-the-project-to-de-skew-images-inside-autocad.html

http://through-the-interface.typepad.com/through_the_interface/2013/08/generating-png-files-for-de-skewed-portions-of-perspective-images.html

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

Sean, you can do it much better than me. Mine doesnot work with curves, hatches nor texts: too complicated for me coding those with Lisp. The only one thing better in my routine is: it is handy, all in one command, and you can start next command by picking on the new created plines of current command.

Actually it is my come back to AutoLisp language. I stop working with Lisp for years and even new to vla, vlax, vlr functions :)

Link to comment
Share on other sites

need help>

 

this feature is great, need help coz when i select the destination frame it turned 180 degress instead of 90 deg. so its coming horizontal instead of vertical, kindly someone teach me to reset it to previous.

 

thanks!

Link to comment
Share on other sites

Just click R to rotate it all around. And make sure you have installed the new version avaiable on the Autodesk App Exchange Store.

You are using AutoCAD Architecture ? Does it work with Architecture ?

Link to comment
Share on other sites

  • 1 month later...
  • 8 years later...

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