TuttoCAD Forum

TuttoCAD Forum
[ Home | Registrati | Discussioni Attive | Discussioni Recenti | Segnalibro | Msg privati | Sondaggi Attivi | Utenti | Album Fotografico | Download | | Cerca | FAQ ]
Nome Utente:
Password:
Salva Password
Password Dimenticata?

 Tutti i Forum
 1 - TuttoCAD Software
 AutoLISP
 Proiezione 2D
 Nuova Discussione  Rispondi
 Versione Stampabile Bookmark this Topic Aggiungi Segnalibro
I seguenti utenti stanno leggendo questo Forum Qui c'è:
Autore Discussione Precedente Discussione Discussione Successiva  

arri
Utente Master


Regione: Lombardia


14951 Messaggi

Inserito il - 13 ottobre 2014 : 09:49:51  Mostra Profilo Invia a arri un Messaggio Privato  Rispondi Quotando
http://www.lee-mac.com/2dprojection.html

Inspired by the superb Projective2D application published by the talented programmer Sean Tessier, here I present an open-source AutoLISP program offering similar functionality.

This program provides the user with a means of applying a projective transformation (also known as a homography, collineation, or less technically, a 'perspective' transformation), projecting a selected set of planar objects from one reference frame (or projective space) to another.

Upon issuing the command syntax 2dpro at the AutoCAD command-line, the user is prompted to select a set of 2D coplanar objects to be projected. This selection is restricted to Arcs, Circles, Elipses, Lines, LWPolylines, 2D (Heavy) Polylines, 2D Splines & Points.

The user is then prompted to select a source reference frame & a destination reference frame. For each of these prompts, the program requires the user to select a closed planar polyline (LWPolyline) with four non-collinear vertices. Following each selection, the program will ensure the points defining the reference frame are counter-clockwise oriented with the points ordered such that the lower-left vertex appears first.

Following valid user responses, the program will then convert the four 2D points defining each reference frame into homogeneous coordinates, and will calculate the transformation matrix to map from the source reference frame (or projective space) to the destination reference frame.

The program will then iterate over the set of selected objects and, for each object, will calculate a 2D point set describing or (in the case of curved objects) approximating the object. Each point is then converted to homogeneous coordinates and mapped to the destination reference frame using the tranformation matrix, before being converted back to cartesian coordinates.

The program will then generate either a Point, Line or LWPolyline from the mapped point(s) with properties matching those of the original object.
  Discussione Precedente Discussione Discussione Successiva  
 Nuova Discussione  Rispondi
 Versione Stampabile Bookmark this Topic Aggiungi Segnalibro
Vai a:
TuttoCAD Forum © 2001-2010 CADLandia Torna all'inizio della Pagina
Pagina generata in 0,48 secondi.