Recent Posts

Pages: [1] 2 3 ... 10
1
They're probably 32 bit controls.
2
.NET / Re: Legal Description in to Civil 3D and AutoCAD
« Last post by Jeff H on Today at 05:54:16 pm »
Isn't this board meant for apps

http://www.theswamp.org/index.php?board=70.0
3
AutoLISP (Vanilla / Visual) / Re: Triangulation (re-visited)
« Last post by ymg on Today at 05:38:51 pm »
Marko,

I agree that the triangulation should return only the convex hull.

But purging the triangle list of any triangle that has one of the
supertriangle vertex in it accomplish the same.

Code: [Select]
; Purge triangle list of any triangle that has a common vertex        ;
; with supertriangle.                                                 ;
   
(setq tl (vl-remove-if-not
             (function
               (lambda (a) (and (< (car a) np)(< (cadr a) np)(< (caddr a) np)))
             )
                     tl
          )
)

What is difficult is not getting the convex hull but getting
the shape of the point cloud.  I have a function Xshape
to do it somewhat interactively, because this problem
is somewhat subjective.

For circumcircle I had tried the pure math approach, it did work
but I rejected it due to the huge speed penalty.

However if you can live with the penalty the approach is
most certainly valid.

ymg

4
AutoLISP (Vanilla / Visual) / Re: Triangulation (re-visited)
« Last post by ribarm on Today at 05:04:06 pm »
ymg, the point of my combined bigger code was to make sure triangulation will end with convex boundary... I've just tried my example with much bigger supertriangle on original Evgeniy's code - X sorting and the result was OK... But I don't think it's too much reliable approach if you only scale supertriangle - of course the speed will be good, but in my experience with dealing with point clouds I've only faced with small clouds with just few info gathered from real terrain field... In my opinion the best way to compensate this lack of info is to interpolate point data with triangulation and as you can conclude, this by my opinion must be correctly done enclosing point cloud with correct boundary triangles... Of course one can cut this triangulation to only segment that can be concave cross shaped terrain model or similar, but for my purposes I prefer circular and convex shapes describing terrain segment in wider area shape - zone... With such triangulation, you can successfully continue to gather data as you now have better approximation of terrain and you can make better and bigger sections and describe surface in its entirety with expected surroundings... If I can recall someone searched the way to create convex hull boundary from point cloud to prepare data for next process - triangulation... This is by my opinion unnecessary as triangulation by itself should create convex hull boundary... And if I may say speed gaining in triangulation should be less important than making result of computation correct... If I was to choose to wait and be sure I'll get what I want, I would wait - I for sure can't make manual corrections be better and faster than correct automatic computation of a machine... That's why we all search for good and reliable programming examples and if you can make it faster then it was in the past then success will be greater, but sometime this can't be afforded in compensation for unreliable results...

As for (getcircumcircle) function I think you may find this code also useful... It's not dealing with angles, but pure math - obtaining coordinates of circle circumscribing 3 points...

Code: [Select]
(defun circumcircle3d ( p1 p2 p3 / v^v circumcircleucs zucs p1ucs p2ucs p3ucs cr )

  (defun v^v ( u v )
    (list
      (- (* (cadr u) (caddr v)) (* (cadr v) (caddr u)))
      (+ (- (* (car u) (caddr v))) (* (car v) (caddr u)))
      (- (* (car u) (cadr v)) (* (car v) (cadr u)))
    )
  )

  (defun circumcircleucs ( p1 p2 p3 / D Dcx Dcy c r )
    (setq D (* 4.0 (- (* (- (car p1) (car p2)) (- (cadr p1) (cadr p3))) (* (- (car p1) (car p3)) (- (cadr p1) (cadr p2))))))
    (setq Dcx (* 2.0 (-
                      (* (- (cadr p1) (cadr p3)) (+ (expt (car p1) 2) (expt (cadr p1) 2) (- (expt (car p2) 2)) (- (expt (cadr p2) 2))))
                      (* (- (cadr p1) (cadr p2)) (+ (expt (car p1) 2) (expt (cadr p1) 2) (- (expt (car p3) 2)) (- (expt (cadr p3) 2))))
                    )
             )
    )
    (setq Dcy (* 2.0 (-
                      (* (- (car p1) (car p2)) (+ (expt (car p1) 2) (expt (cadr p1) 2) (- (expt (car p3) 2)) (- (expt (cadr p3) 2))))
                      (* (- (car p1) (car p3)) (+ (expt (car p1) 2) (expt (cadr p1) 2) (- (expt (car p2) 2)) (- (expt (cadr p2) 2))))
                    )
             )
    )
    (setq c (list (/ Dcx D) (/ Dcy D)))
    (setq r (distance c p1))
    (list c r)
  )
 
  (setq zucs (v^v (mapcar '- p2 p1) (mapcar '- p3 p1)))
  (setq p1ucs (trans p1 0 zucs) p2ucs (trans p2 0 zucs) p3ucs (trans p3 0 zucs))
  (setq cr (circumcircleucs p1ucs p2ucs p3ucs))
  (list (trans (list (caar cr) (cadar cr) (caddr p1ucs)) zucs 0) (cadr cr))
)
5
.NET / Legal Description in to Civil 3D and AutoCAD
« Last post by neyton on Today at 04:53:43 pm »
To create legal descriptions inside Civil 3D and AutoCAD, try this:

http://tbn2net.appspot.com/showpac?pacid=C3DMEMO

Free trial: 15 days
Students: free for 6 moths
6
CAD General / Re: Titleblock scale disclaimer
« Last post by alanjt on Today at 04:27:20 pm »
I think I'll just create a secondary cover sheet that's nothing but a long disclaimer and 10-15 graphic scales.
7
AutoLISP (Vanilla / Visual) / Re: Triangulation (re-visited)
« Last post by ymg on Today at 04:11:18 pm »
Marko,

I do not understand!

As it is, if I run triangulate  or your version of it
I end up with the same exact triangulation.

Only difference is you are going in Y order
while it was going in x order.

For speed the getcircumcircle function is critical.
Tried as I may, I could not come up with anything
better than Evgenyi had.  I did get a very marginal speedup
by putting it inline with the code instead of calling a function.

Another marginal gain was declaring *-pi/2* as a global
variable.

ymg
8
CAD General / Re: Titleblock scale disclaimer
« Last post by mjfarrell on Today at 04:04:07 pm »
Yall seem to forget that distortion could be in different directions. X might be 1" but the Y could be foobar...
Better have two scales in each direction.
would this cover it?   :whistling:
9
AutoLISP (Vanilla / Visual) / Re: Notepad+++
« Last post by ChrisCarlson on Today at 03:49:10 pm »
Very nice! Thanks!
10
AutoLISP (Vanilla / Visual) / Re: Notepad+++
« Last post by ymg on Today at 03:40:21 pm »
Chris,

Here, may be a bit better with the argument to the function.

Code: [Select]
<parser id="lisp_function" displayName="Lisp">
     <function
  mainExpr="[ \t]*\([ \t]*defun[ \t]+[a-zA-Z0-9_+\-*/<>=:.!?@%&|]+[ \t]+\([a-zA-Z0-9_+\-*/<>=:.!?@%&| \t]*\)"
displayMode="$className->$functionName">
     </function>
</parser>
Pages: [1] 2 3 ... 10