Jump to content

Recommended Posts

Posted

hello

i want to get coordinates of intersection lines of isoline of a sphere but can't snape to it so if it convert it to spline or 3dpolyline i cant get coordintes

any help will be apprciated 

screenshot.png

Posted
2 hours ago, motee-z said:

hello

i want to get coordinates of intersection lines of isoline of a sphere but can't snape to it so if it convert it to spline or 3dpolyline i cant get coordintes

any help will be apprciated 

screenshot.png

@motee-z       Please upload  sphere and plane . What  do you need to get.?  

Posted (edited)

My first idea... It should be possible to draw the isolines of a sphere.

And to make polylines out of them.

At the center you draw a circle, radius R

midpoint between center and top there's a circle (like a latitude parallel), radius = cosinus something  (EDIT, probably acosinus) 

 

repeat for other fractions ... how many depends on the isolines (not yet sure how to read that setting)

...

 

Edited by Emmanuel Delay
Posted

The isolines of a sphere are circles.  If your end goal is to represent them as splines then you can do the following to create a spline that exactly fits a  90° arc.

  1. Create a spline of degree 2 using the control vertex method:
    spline d 2 m cv
  2. For an arc of radius = 1 specify the following three points:
    1,0
    1,1
    0,1
  3. Change the weight of the second CV to 0.7072  (sqrt(2)/2)
    splinedit v w  (n to second CV then 0.7071)

The white line below is a spline the red is a circle.

image.png.80b9dc9705579f0496f51e0469255100.png

 

Posted

@motee-z

You have more than 300 posts... Give some effort to achieve what you wanted... Then if you wish, you can share it... For sphere I think there should be no problems, but generally speaking in various 3D objects, isolines are hard to extract to be like @lrmsuggested... I think that even .NET can't do it through splines, but 3d polylines...

Posted
22 hours ago, motee-z said:

What about to draw the isolines. 

@motee-z      @ et all 

I do a lisp to draw parallel isolines "aka PARALLEL"  , the sphere , and  sphere rotation   axis 

As I do not know how to draw the meridians to a UCS  , I ask for help to handle the UCS to draw the meridians 

 

;; Design by Gabo CALOS DE VIT from CORDOBA ARGENTINA
;;;    Copyleft 1995-2023 by Gabriel Calos De Vit ; DEVITG@GMAIL.COM    
;;

 ; Hecho por  Gabo CALOS DE VIT de CORDOBA ARGENTINA
;;;    Copyleft 1995-2023 por Gabriel Calos De Vit 
;; DEVITG@GMAIL.COM 
;;; inicio-defun-08-03-23
;;************************************************************
(DEFUN &-CIRCLE-CO/P1-R1-CO  (P1 R1 CO)
  (IF (= (TYPE P1) 'LIST)
    (SETQ P1 (VLAX-3D-POINT P1)))
  (IF (= CO NIL)
    (SETQ CO ACBYLAYER)
    )
  (SETQ CIRCLE# (VLA-ADDCIRCLE MODEL P1 R1))
  (VLA-PUT-COLOR CIRCLE# CO)
  CIRCLE#
  )
;;************************************************************
(DEFUN ASIN  (NUM)
  (COND
    ((EQUAL NUM 1 1e-12) (/ PI 2))
    ((EQUAL NUM -1 1e-12) (/ PI -2))
    ((< -1 NUM 1)
     (ATAN NUM (SQRT (- 1 (EXPT NUM 2))))
     )
    )
  )

;;;(setq num (/ step rad ))

(DEFUN &-LAY-CO/NAME-COLOR  (LAYER-NAME
                             COLOR
                             /
                             )
  (IF (= COLOR NIL)
    (SETQ COLOR 256)
    )

  (IF (TBLSEARCH "LAYER" LAYER-NAME)
    (PROGN
      (SETQ LAY-NEW (VLA-ITEM LAY-COLL LAYER-NAME))
      (IF (= (VLA-GET-FREEZE LAY-NEW) :VLAX-FALSE)
        (PRINC)
        (VLA-PUT-FREEZE LAY-NEW :VLAX-FALSE)
        )
      (VLA-PUT-LAYERON LAY-NEW :VLAX-TRUE)
      (VLA-PUT-COLOR LAY-NEW COLOR)
      (VLA-PUT-ACTIVELAYER ADOC LAY-NEW)
      (VLA-ITEM LAY-COLL LAYER-NAME)
      ) ;_ progn si existe , y la descongela y la prende
    (PROGN
      (SETQ LAY-NEW (VLA-ADD LAY-COLL LAYER-NAME))
      (VLA-PUT-ACTIVELAYER ADOC LAY-NEW)
      (VLA-PUT-COLOR LAY-NEW COLOR)

      LAY-NEW
      ) ;Progn si no existe
    ) ;_ controla si existe la capa 
  ) ;



;;************************************************************
(DEFUN INITIO  ()
  (VL-LOAD-COM)
  (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) ;_ el programa ACAD 
  (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) ;_ el DWG que esta abierto-
  (SETQ MODEL (VLA-GET-MODELSPACE ADOC))
  (setq lay-coll (VLA-GET-LAYERS adoc))
   )

(setq solo-una "_:S+.")
;end master

(DEFUN SPHERE-ISOLINES  (/
;;;ACAD-OBJ ADOC ALFA CENTER MODEL RAD RADX SPHERE STEP STEPX URIG

                         )

(VL-LOAD-COM)
  (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT)) 
  (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ))
  (SETQ MODEL (VLA-GET-MODELSPACE ADOC))
  (SETQ LAY-COLL (VLA-GET-LAYERS ADOC))

(setq clayer (getvar 'clayer))






  
  
(setq rad 50.0)
(setq radx rad)
(setq center '( 0 0 0 ))
(Setq urig center )
(setq step 1 )  
(setq stepx step)


  
(&-LAY-CO/NAME-COLOR "sphere" 3)
  
(Setq sphere (VLA-ADDSPHERE model (VLAX-3D-POINT urig) rad))

(vl-cmdf "CONVTOSURFACE" (entlast) "" )

(&-LAY-CO/NAME-COLOR "nort" 1)

  
(repeat  (fix (/ rad step))
 (if (> radx 0)
   (progn
  (&-CIRCLE-CO/P1-R1-CO center radx 1) 
(setq center ( mapcar '+ urig (list 0 0 step)))
;(setq rad (- rad step))
( Setq alfa(ASIN (/ step rad)))

(setq radx  (* rad (cos alfa)))
(setq step ( + step stepx))
);end progn
) ;end   if
);end repeat


(&-LAY-CO/NAME-COLOR "south" 4)
  
(setq step 1)  
(setq center urig)
(setq radx rad)  
(repeat  (1- (fix (/ rad stepx)))

(if (> radx 0)
  (progn 
(setq center ( mapcar '+ urig (list 0 0 ( - step))))
  (&-CIRCLE-CO/P1-R1-CO center radx 4) 
( Setq alfa(ASIN (/ step rad)))

(setq radx  (* rad (cos alfa)))
(setq step ( + step stepx))
);end progn
);end if
  
);end repeat 

(setq max-z ( mapcar '+ urig (list 0 0 (+ 15 rad))))

(setq min-z  ( mapcar '- urig (list 0 0 (+ 15 rad)))) 
(&-LAY-CO/NAME-COLOR "axis" 6)
(setq z-axis (VLA-ADDLINE model (VLAX-3D-POINT max-z ) (VLAX-3D-POINT min-z )))
  
  
  

(&-LAY-CO/NAME-COLOR "meridians" 2)
;; I do not know how to set the new UCS to draw the meridians
  (vl-cmdf "ucs" "o" (entlast))
(setq greenwich ( &-CIRCLE-CO/P1-R1-CO urig rad 256))
  
                        
 )


   ;end SPHERE-ISOLINES

sphere isolines.dwg

 

 

 

 

sphere isolines.dwg sphere isolines.lsp

Posted

You ask "As I do not know how to draw the meridians to a UCS  , I ask for help to handle the UCS to draw the meridians"

 

The term "isolines" in CAD usually refers to lines of constant u, and v in parametric space.  Meridians apply to spheres e.g., latitude lines are meridians, longitude lines are not. 


Are you asking how to draw the circle that defines a meridian give the location  of  UCS on a sphere?    What are the givens, i.e., a sphere, ucs,...

What do you want as output?

 

 

Posted
43 minutes ago, lrm said:

You ask "As I do not know how to draw the meridians to a UCS  , I ask for help to handle the UCS to draw the meridians"

 

The term "isolines" in CAD usually refers to lines of constant u, and v in parametric space.  Meridians apply to spheres e.g., latitude lines are meridians, longitude lines are not. 


Are you asking how to draw the circle that defines a meridian give the location  of  UCS on a sphere?    What are the givens, i.e., a sphere, ucs,...

What do you want as output?

 

 

Please open both dwg and lisp . 

My intention is to draw the meridians at the given sphere, Parallel are done . 

 

 

Posted
2 hours ago, devitg said:

Please open both dwg and lisp .

 

There is only one drawing.  I ran the lisp.  What more specifically more do you want it to do? It created a solid shere, a surface model, and a bunch of circles, some of which are meridians.  At one point you were talking about 3dpolys and splines.  Your lisp has neither.

 

My intention is to draw the meridians at the given sphere, Parallel are done . 

The drawing has a collection of meridians.  What do you mean by "Parallels are done".  

You did not answer my questions from the previous post. 

2 hours ago, devitg said:

 

There is only one drawing.

Posted
12 hours ago, lrm said:

You did not answer my questions from the previous post. 

There is only one drawing.

I'm not the original poster.

I'm trying to mimic the isolines, just as an intellectual or brain exercise .

 

Yes it is only one Drawing. it hold a sphere, a surface, the sphere axis, and  what you call meridians are   parallels 

 

Quote

Lines of latitude, also called parallels, are imaginary lines that divide the Earth. They run east to west, but measure your distance north or south. The equator is the most well known parallel. At 0 degrees latitude, it equally divides the Earth into the Northern and Southern hemispheres.Jan 20, 2023

PARALLES

 

 

So if you see at my lsp , after it draw all said entities,  I want to draw the "meridians" . So I need the UCS to be  so I can draw meridians, I will first draw the "fake" Greenwich meridian, and then copy an rotate by 15º degree,on the Earth  axis,  or ( /  (* 2 pi) 24) , to complete 24 meridians. 

 

Quote

It divides the Earth into the eastern and western hemispheres. The antimeridian is on the opposite side of the Earth, at 180 degrees longitude. Though the antimeridian is the basis for the international date line, actual date and time zone boundaries are dependent on local laws.Jan 20, 2023

  Meridians

 

 

Posted

I misread the definition of meridian.  My error.

 

I think something like the following will set the UCS as you want.  In this example the UCS xy plane will be 15° rotated from the Greenwich meridian.

(defun dtr (angDeg /) (/ (* angDeg pi) 180.))
(defun c:SetMeridian (/)
  (command "_ucs" "") ; change to WCS
  (setq	ctr '(200 150 0)
	ang 15
  )
  (setq zdir (mapcar '+ ctr (list (cos (dtr ang)) (sin (dtr ang)) 0.0)))
  (command "_ucs" "ZA" ctr zdir "")

  (princ)


)

 

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