;;--------------------------------------------------------------------------* ;; Copyright 2007 DC4 Technisches Büro GmbH * ;; * ;;--------------------------------------------------------------------------* (in-package :custom) (use-package :OLI) ;;--------------------------------------------------------------------------* (sd-defdialog 'dc4-achsabstand-berechnen-dialog :dialog-title "Achsabstand" ;;:dialog-control :sequential :variables '( (achs1 :selection (*sd-cone-seltype* *sd-torus-seltype* *sd-cylinder-seltype*) :multiple-items nil :prompt-text "Erste Rotationsflaeche angeben" :title "1. Achse" :initial-value nil :after-input (go-action) ) (achs2 :selection (*sd-cone-seltype* *sd-torus-seltype* *sd-cylinder-seltype*) :multiple-items nil :prompt-text "Zweite Rotationsflaeche angeben" :title "2. Achse" :initial-value nil :after-input (go-action) ) (abst :value-type :display-only :title "Abstand" :initial-value 0 ) (ausr :value-type :display-only :title "Achsricht." :initial-value nil ) ) :local-functions '( (go-action () (let (p1 dir1 p2 dir2 pabst wink) (when (and achs1 achs2) (progn (setf nabst (sd-call-cmds (measure_dist :sf_sf achs1 achs2))) (cond ((sd-cylinder-p (sd-inq-geo-props achs1)) (progn (setf p1 (sd-cylinder-center (sd-inq-geo-props achs1 :dest-space :global))) (setf dir1 (sd-cylinder-axis-dir (sd-inq-geo-props achs1 :dest-space :global))) );;progn );;cylinder ((sd-cone-p (sd-inq-geo-props achs1)) (progn (setf p1 (sd-cone-apex (sd-inq-geo-props achs1 :dest-space :global))) (setf dir1 (sd-cone-axis-dir (sd-inq-geo-props achs1 :dest-space :global))) );;progn );;cone ((sd-torus-p (sd-inq-geo-props achs1)) (progn (setf p1 (sd-torus-center (sd-inq-geo-props achs1 :dest-space :global))) (setf dir1 (sd-torus-axis-dir (sd-inq-geo-props achs1 :dest-space :global))) );;progn );;torus );cond (cond ((sd-cylinder-p (sd-inq-geo-props achs2)) (progn (setf p2 (sd-cylinder-center (sd-inq-geo-props achs2 :dest-space :global))) (setf dir2 (sd-cylinder-axis-dir (sd-inq-geo-props achs2 :dest-space :global))) );;progn );;cylinder ((sd-cone-p (sd-inq-geo-props achs2)) (progn (setf p2 (sd-cone-apex (sd-inq-geo-props achs2 :dest-space :global))) (setf dir2 (sd-cone-axis-dir (sd-inq-geo-props achs2 :dest-space :global))) );;progn );;cone ((sd-torus-p (sd-inq-geo-props achs2)) (progn (setf p2 (sd-torus-center (sd-inq-geo-props achs2 :dest-space :global))) (setf dir2 (sd-torus-axis-dir (sd-inq-geo-props achs2 :dest-space :global))) );;progn );;torus );cond (if (sd-vec-null-p (sd-vec-cross-product (sd-vec-normalize dir1) (sd-vec-normalize dir2))) ;;(sd-vec-colinear-p dir1 dir2) (progn (setf pabst (sd-call-cmds (measure_dist :between_points p1 p2))) (setf wink (sd-vec-angle-between dir1 (sd-vec-subtract p1 p2))) (setf abst (abs (* pabst (sin wink)))) (setf ausr "parallel") );;progn (progn (setf abst 0) (setf ausr "windschief") );;progn );;if );;progn );;when );;let ) ) :ok-action '() :help-action '() )