

;=====================================================================================================================================================
;																									
;	( PIEL-03 )	 		CALCULA PIEL NUEVA-COBRA en 3D y 2D															
;																									
;					** SPLINES-PLANAS ** ABIERTAS ** en PLANOS NO PARALELOS *** VARIAS CURVATURA CON PUNTOS DE INFLEXION ***			
;																									
;																									
;	PLANIFICA PIEL ENTRE DOS (SPLINES-PLANAS  ABIERTAS en PLANOS NO PARALELOS Y UNA SOLA CURVATURA) (SPLINE-A) (SPLINE-B)					
;																									
;	PUNTEANDOLAS a Distancia= GRADUA-(MODU) => DIVIDE ==> ( LIS-PA ) y ( LIS-PB )												
;																									
;	PUNTOS INTERSECCION DE PLANOS de Secciones (A) y (B) => (TRAZ-1) (TRAZ-2)												
;																									
;	INERSECCION TANGENTE-( PA2 (PA1-PA3)) con TRAZA-( TRAZ-1 TRAZ-2 ) => ( POtag )											
;																									
;	DISTANCIAS de (PB1) y (PB3) a RECTA-(POtag PB2)  ( SI ((B1yy) y (B3yy)) son del MISMO SIGNO  => (POtag-PB2)=(TANGENTE a (SPLINE-B))			



;																									
;	FORMA CARA (3A1 3A2 3B1 3B2) INTERSECCION de (3 TANG-A)=> (3A1 3A2) y (3 TANG-B)=> (3B1 3B2) 	*** (PINTA-3D-2D) ***					



;																									
;																									
;=====================================================================================================================================================







;=====================================================================================================================================================
;																									
;									*** ***  SUB-PROGRAMAS  *** ***											
;																									
;=====================================================================================================================================================


;-----------------------------------------------------------------------------------------------------------------------------------------------------
;	SPLINE-A   GRADUA	y DIVIDE => ( LIS-PA )  																	

	(DEFUN SPLI-A ( / )

		(SETQ SA00 (ENTSEL" MARCA --- SPLINE ABIERTA-3D --- SECCION-A ? ")) (TERPRI)
		(SETQ NA00  (CAR SA00)) 									; nombre Spline A 
		(SETQ ALIS  (ENTGET NA00))  									; lista Spline A
		(SETQ AELE  (ASSOC 10 ALIS))  								; 1ş Punto Asociado a 10 (10.punto)
		(SETQ AELES (MEMBER AELE ALIS)) 								; lista a partir del Alterior (10.punto)....(11.punto)
		(SETQ A-primer (CDR (NTH 0 AELES))) 							; primer elemento (10.punto)
		(SETQ A-ultimo (CDR (NTH (- (LENGTH AELES) 1) AELES)))				; ultimo elemento (11.punto)
		(COMMAND "color" 1 "TEXTO" A-primer 0.2 0 "A")						; TEXTO = A
		(COMMAND "PUNTO" A-primer)									; PINTA 1Ş punto A
		(SETQ N-enti-A1 (ENTLAST))									; nombre ultima entidad principal 1ş punto A
		(COMMAND "GRADUA" NA00 MODU)									; gradua SPLI-A
		(COMMAND "PUNTO" A-ultimo)									; PINTA Ultimo Punto A
	
		;	PUNTOS SECCION-A (PA1-PAn) =>   LIS-PA  Lon-LPA															
		(SETQ LIS-PA nil)											; LISTA  PUNTOS-A
		(SETQ LIS-PA (CONS (CDR (ASSOC 10 (ENTGET N-enti-A1))) LIS-PA))			; lista entidad -> (1ş Punto-A)
		(SETQ W1A T)
		(WHILE W1A
			(SETQ N-enti-A2 (ENTNEXT N-enti-A1))						; Nombre entidad siguiente
			(COMMAND "BORRA" N-enti-A1 "")
			(IF (= N-enti-A2 nil)  (SETQ W1A nil)
				(PROGN
					(SETQ LIS-PA (CONS (CDR (ASSOC 10 (ENTGET N-enti-A2))) LIS-PA))
					(SETQ N-enti-A1  N-enti-A2 )
				);progn
			);if
		) ;While W1A
		;	LISTA ( LIS-PA )																				
		(SETQ LIS-PA  (REVERSE LIS-PA))
		(SETQ NşPA (LENGTH LIS-PA))

		;	SPLINE-A   DIVIDE																				
		(SETQ ALIS  (ENTGET NA00))  									; lista Spline A
		(SETQ AELE  (ASSOC 10 ALIS))  								; 1ş Punto Asociado a 10 (10.punto)
		(SETQ AELES (MEMBER AELE ALIS)) 								; lista a partir del Alterior (10.punto)....(11.punto)
		(SETQ A-primer (CDR (NTH 0 AELES))) 							; primer elemento (10.punto)
		(SETQ A-ultimo (CDR (NTH (- (LENGTH AELES) 1) AELES)))				; ultimo elemento (11.punto)
		(COMMAND "color" 1 "TEXTO" A-primer 0.2 0 "A")						; TEXTO = A
		(COMMAND "PUNTO" A-primer)									; PINTA 1Ş punto A
		(SETQ N-enti-A1 (ENTLAST))									; nombre ultima entidad principal 1ş punto A
		(COMMAND "DIVIDE" NA00 (- NşPA 1))								; DIVIDE SPLI-A
		(COMMAND "PUNTO" A-ultimo)									; PINTA Ultimo Punto A
	
		;	PUNTOS SECCION-A (PA1-PAn) =>   LIS-PA  Lon-LPA															
		(SETQ LIS-PA nil)											; LISTA  PUNTOS-A
		(SETQ LIS-PA (CONS (CDR (ASSOC 10 (ENTGET N-enti-A1))) LIS-PA))			; lista entidad -> (1ş Punto-A)
		(SETQ W1A T)
		(WHILE W1A
			(SETQ N-enti-A2 (ENTNEXT N-enti-A1))						; Nombre entidad siguiente
			;(COMMAND "BORRA" N-enti-A1 "")
			(IF (= N-enti-A2 nil)  (SETQ W1A nil)
				(PROGN
					(SETQ LIS-PA (CONS (CDR (ASSOC 10 (ENTGET N-enti-A2))) LIS-PA))
					(SETQ N-enti-A1  N-enti-A2 )
				);progn
			);if
		) ;While W1A
		;	LISTA ( LIS-PA )																				
		(SETQ LIS-PA  (REVERSE LIS-PA))
		;  (LENGTH LIS-PA)

	) ; Defun SPLI-A

;																									
;-----------------------------------------------------------------------------------------------------------------------------------------------------


;-----------------------------------------------------------------------------------------------------------------------------------------------------
;	SPLINE-B   GRADUA	y DIVIDE => ( LIS-PB ) 																		

	(DEFUN SPLI-B ( / )

		(SETQ SB00 (ENTSEL" MARCA --- SPLINE ABIERTA 3D --- SECCION-B ? ")) (TERPRI) (TERPRI)
		(SETQ NB00  (CAR SB00)) 									; nombre Spline B 
		(SETQ BLIS  (ENTGET NB00))  									; lista Spline B 
		(SETQ BELE  (ASSOC 10 BLIS))  								; 1ş Punto Asociado a 10 (10.punto)
		(SETQ BELES (MEMBER BELE BLIS)) 								; lista a partir del Alterior (10.punto)....(11.punto)
		(SETQ B-primer (CDR (NTH 0 BELES))) 							; primer elemento (10.punto)
		(SETQ B-ultimo (CDR (NTH (- (LENGTH BELES) 1) BELES))) 				; ultimo elemento (11.punto)
		(COMMAND "color" 5 "TEXTO" B-primer 0.2 0 "B")						; TEXTO = B
		(COMMAND "PUNTO" B-primer)									; PINTA 1Ş punto B
		(SETQ N-enti-B1 (ENTLAST))									; nombre ultima entidad principal 1Ş punto B
		(COMMAND "GRADUA" NB00 MODU)									; gradua SPLI-B
		(COMMAND "PUNTO" B-ultimo)									; PINTA Ultimo Punto B

		;	PUNTOS SECCION-B (PB1-PBn) => LIS-NB  LIS-PB  Lon-LPB													-
		(SETQ LIS-PB  nil)										; LISTA  PUNTOS-B
		(SETQ LIS-PB (CONS (CDR (ASSOC 10 (ENTGET N-enti-B1))) LIS-PB)) 			; lista entidad  -> (1ş Punto-B)
		(SETQ W1B T)
		(WHILE W1B
			(SETQ N-enti-B2 (ENTNEXT N-enti-B1))						; Nombre entidad siguiente
			(COMMAND "BORRA" N-enti-B1 "")
			(IF (= N-enti-B2 nil) (SETQ W1B nil)
				(PROGN
					(SETQ LIS-PB (CONS (CDR (ASSOC 10 (ENTGET N-enti-B2))) LIS-PB))
					(SETQ N-enti-B1  N-enti-B2 )
				);progn
			);if
		) ;While W1B
		;	LISTA ( LIS-PB )																				
		(SETQ LIS-PB  (REVERSE LIS-PB))
		(SETQ NşPB (LENGTH LIS-PB))

		;	SPLINE-B   DIVIDE																				
		(SETQ BLIS  (ENTGET NB00))  									; lista Spline B 
		(SETQ BELE  (ASSOC 10 BLIS))  								; 1ş Punto Asociado a 10 (10.punto)
		(SETQ BELES (MEMBER BELE BLIS)) 								; lista a partir del Alterior (10.punto)....(11.punto)
		(SETQ B-primer (CDR (NTH 0 BELES))) 							; primer elemento (10.punto)
		(SETQ B-ultimo (CDR (NTH (- (LENGTH BELES) 1) BELES))) 				; ultimo elemento (11.punto)
		(COMMAND "color" 5 "TEXTO" B-primer 0.2 0 "B")						; TEXTO = B
		(COMMAND "PUNTO" B-primer)									; PINTA 1Ş punto B
		(SETQ N-enti-B1 (ENTLAST))									; nombre ultima entidad principal 1Ş punto B
		(COMMAND "DIVIDE" NB00 (- NşPB 1))								; DIVIDE SPLI-B
		(COMMAND "PUNTO" B-ultimo)									; PINTA Ultimo Punto B

		;	PUNTOS SECCION-B (PB1-PBn) => LIS-NB  LIS-PB  Lon-LPB													-
		(SETQ LIS-PB  nil)										; LISTA  PUNTOS-B
		(SETQ LIS-PB (CONS (CDR (ASSOC 10 (ENTGET N-enti-B1))) LIS-PB)) 			; lista entidad  -> (1ş Punto-B)
		(SETQ W1B T)
		(WHILE W1B
			(SETQ N-enti-B2 (ENTNEXT N-enti-B1))						; Nombre entidad siguiente
			;(COMMAND "BORRA" N-enti-B1 "")
			(IF (= N-enti-B2 nil) (SETQ W1B nil)
				(PROGN
					(SETQ LIS-PB (CONS (CDR (ASSOC 10 (ENTGET N-enti-B2))) LIS-PB))
					(SETQ N-enti-B1  N-enti-B2 )
				);progn
			);if
		) ;While W1B

		;	LISTA ( LIS-PB )																				
		(SETQ LIS-PB  (REVERSE LIS-PB))
		;  (LENGTH LIS-PB)

	) ; Defun SPLI-B

;																									
;-----------------------------------------------------------------------------------------------------------------------------------------------------


;-----------------------------------------------------------------------------------------------------------------------------------------------------
;	Puntos ** TRAZA ** de PLANOS de Secciones (A) y (B) => (TRAZ-1) (TRAZ-2)												

	(DEFUN TRAZA-AB ( / )

		(COMMAND "SCP" "B" NA00 )		; PLANO Sa
 			(SETQ Sa0 (TRANS (LIST    0   0 0) 1 0))
 			(SETQ Sa1 (TRANS (LIST  100 100 0) 1 0))
 			(SETQ Sa2 (TRANS (LIST -100 100 0) 1 0))
		(COMMAND "SCP" "U")

		(COMMAND "SCP" "B" NB00 )		; PLANO Sb
 			(SETQ Sa0b (TRANS Sa0 0 1))
 			(SETQ Sa1b (TRANS Sa1 0 1))
 			(SETQ Sa2b (TRANS Sa2 0 1))
 			(SETQ Sb0 (TRANS (LIST (CAR Sa0b) (CADR Sa0b) 0) 1 0))
 			(SETQ Sb1 (TRANS (LIST (CAR Sa1b) (CADR Sa1b) 0) 1 0))
 			(SETQ Sb2 (TRANS (LIST (CAR Sa2b) (CADR Sa2b) 0) 1 0))
		(COMMAND "SCP" "U")


		(SETQ TRAZ-1 (INTERS Sa0 Sa1 Sb0 Sb1 nil))
		(SETQ TRAZ-2 (INTERS Sa0 Sa2 Sb0 Sb2 nil))

		;(COMMAND "COLOR" 7 "LINEA" TRAZ-1 TRAZ-2 "")

	) ; Defun TRAZA-AB

;																									
;-----------------------------------------------------------------------------------------------------------------------------------------------------


;-----------------------------------------------------------------------------------------------------------------------------------------------------
;		PINTA CARAS en 3D y 2D																				

		(DEFUN PINTA-3D-2D ( / )

					(COMMAND "SCP" "N" "3P" 3B1 3A1 3A2)		; SCP-A

						(SETQ 2A1a (TRANS 3A1 0 1))
						(SETQ 2B1a (TRANS 3B1 0 1))
						(SETQ 2A2a (TRANS 3A2 0 1))
						(SETQ 2B2a (TRANS 3B2 0 1))

					(COMMAND "SCP" "U")

					(COMMAND "SCP" "N" "3P" 2KKB 2KKA "")		; SCP-2D

						(SETQ 2A1 (TRANS 2A1a 1 0))
						(SETQ 2B1 (TRANS 2B1a 1 0))
						(SETQ 2A2 (TRANS 2A2a 1 0))
						(SETQ 2B2 (TRANS 2B2a 1 0))

					(COMMAND "SCP" "U")

					;(COMMAND "color" 5 "3DPOL"  2A1 2B1 2B2 2A2 2A1 "" )

					(COMMAND "COLOR" 1 "LINEA" 2A1 2A2 "" )
					(COMMAND "COLOR" 8 "LINEA" 2A1 2B1 "" )
					(COMMAND "COLOR" 8 "LINEA" 2A2 2B2 "" )

					(IF (NOT (EQUAL 2B1 2B2 0.00001))
					(COMMAND "COLOR" 5 "LINEA" 2B1 2B2 "" ))

					(COMMAND "COLOR" COLO "3DCARA" 3A1 3B1 3B2 3A2 "" )

					(SETQ 2KKB 2B2 2KKA 2A2) 

		) ; defun PINTA-3D-2D

;																									
;-----------------------------------------------------------------------------------------------------------------------------------------------------




;=====================================================================================================================================================
;	*** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** PROGRAMA *** 		
;=====================================================================================================================================================

(DEFUN C:PIEL-03 (/ )
  
	;	ARRANCANDO																						

	(SETVAR "blipmode" 0) (SETVAR "cmdecho" 0) (GRAPHSCR) (COMMAND "-REFENT" "DES"  "SCP" "U"  "ORTO" "DES")

	;-----------------------------------------------------------------------------------------------------------------------------------------------
	;	FIJA PARAMETROS																					
	;-----------------------------------------------------------------------------------------------------------------------------------------------


	(SETQ NşCapa  (GETINT " NOMBRE de CAPA (204 ?) = ")) (TERPRI)	; Nş NOMBRE DE CAPA

	(SETQ MODU  0.2 )									; DISTANCIA ENTRE PUNTOS DE GRADUA (SECCION-A)

	(SETQ DIVI 4 )									; NUMERO de PUNTOS que RETROCEDE Nb (/ (LENGTH LIS-PB) DIVI )


	;-----------------------------------------------------------------------------------------------------------------------------------------------


	;																								
	;	CALCULOS																						

	(SETQ NşCapa (- NşCapa 1))
	(SETQ W1 T)

	(WHILE W1
		(SETQ NşCapa (+ NşCapa 1))
		(COMMAND "CAPA" "E" NşCapa "") 					; crea y activa capa NşCapa

		(SPLI-A)									; Gradua y Divide (SPLINE-A) => Puntos ( LIS-PA )
		(SPLI-B)									; Gradua y Divide (SPLINE-B) => Puntos ( LIS-PB )

		(TRAZA-AB)									; INTERSECCION PLANOS SPLINE-A SPLINE-B => (TRAZ-1) (TRAZ-2)

		;	INERSECCION TANGENTE-( PA1 PA3 en PA2 ) con TRAZA-( TRAZ-1 TRAZ-2 ) => ( POtag )									

		;(SETQ Na -2 )

		(SETQ NşA  9 )
		(SETQ Na  -1 )

		(SETQ 2KKB (LIST 0 0  0))
 		(SETQ 2KKA (LIST 0 -1 0))

		(SETQ Nb (- (/ (LENGTH LIS-PB) DIVI )))
		;(SETQ Nb -1)

		(SETQ  PT-A2 nil  PT-00 nil  PT-B2 nil  PT-00 nil )

		;(REPEAT (+ (LENGTH LIS-PA) 2)								; *** *** REPEAT-LIS-PA1
		(REPEAT (LENGTH LIS-PA)										; *** *** REPEAT-LIS-PA1

			(SETQ NşA (+ NşA 1))
			(SETQ Na  (+ Na  1))

			;(IF (< Na 0) (SETQ Na (+ (LENGTH LIS-PA) Na))  )

			(SETQ PA1 (NTH (REM (+ Na 0) (LENGTH LIS-PA)) LIS-PA))
			(SETQ PA2 (NTH (REM (+ Na 1) (LENGTH LIS-PA)) LIS-PA))		; PUNTO A

			;	SI es PARALELA ( PA2 PA213 ) a ( TRAZ-1 TRAZ-2 )  =>  ( POtag )	INTERSECCION con TRAZA							

			(COMMAND "SCP" "3P" TRAZ-1 TRAZ-2 PA1 )				; PLANO TRAZ

				(SETQ PA1-TR (TRANS PA1 0 1))
				(SETQ PA2-TR (TRANS PA2 0 1))

				(IF (EQUAL (CADDR PA2-TR) 0 0.0000001)	   					; Coplanario ( PA2 ) con ( TRAZ-1 TRAZ-2 PA1 )

					(PROGN
						(IF (EQUAL (CADR PA-TR) (CADR PA2-TR) 0.0000001)		; Paralela ( PA1 PA2 ) a ( TRAZ-1 TRAZ-2 )

							(SETQ POtag (TRANS (LIST 100000000000000 0 0) 1 0))	; PARALELAS

							(SETQ POtag (INTERS PA1 PA2  TRAZ-1 TRAZ-2 nil))	; SE CRUZAN

						) ; if
					) ; progn

					(PROGN
						(PROMPT "------ (PA1 PA2) y (TRAZ-1 TRAZ-2) NO SON COPLANARIAS ") (TERPRI)
					) ; progn

				) ; if

			(COMMAND "SCP" "U")

			;	DISTANCIAS de ( PB1 ) y ( PB3 ) a RECTA-( POtag  PB2 )  ( SI ( B1yy ) y ( B3yy ) son del Mismo Signo RECTA => TANGENTE )	

			;(SETQ NşB  0 )
			;(SETQ Nb  -1 )
			;(SETQ Wb   T )

			(SETQ DISm 100000.0)

			;(WHILE Wb										; *** *** REPEAT-LIS-PB1

			(REPEAT (* 2 (/ (LENGTH LIS-PB) DIVI))								; *** *** REPEAT-LIS-PB1

				;(SETQ NşB (+ NşB 1))
				(SETQ Nb (+ Nb 1))

				(IF (< Nb 0) (SETQ Nb (+ (LENGTH LIS-PB) Nb))  )

				(SETQ PB1 (NTH (REM (+ Nb 0) (LENGTH LIS-PB)) LIS-PB))
				(SETQ PB2 (NTH (REM (+ Nb 1) (LENGTH LIS-PB)) LIS-PB))	; PUNTO B
				(SETQ PB3 (NTH (REM (+ Nb 2) (LENGTH LIS-PB)) LIS-PB))

				(COMMAND "SCP" "3P" POtag PB2 TRAZ-1 )				; PLANO POtag

					(SETQ B1yy (CADR (TRANS PB1 0 1)))
					(SETQ B3yy (CADR (TRANS PB3 0 1)))

				(COMMAND "SCP" "U")

				(COND
					( (OR (AND (>= B1yy 0) (> B3yy 0))
						(AND (<= B1yy 0) (< B3yy 0)) )

						(COND
							( (< (DISTANCE PA2 PB2) DISm)

								(SETQ
									DISm   (DISTANCE PA2 PB2)

									PT-A2  PA2

									PT-00  POtag
									PT-B2  PB2

									NNşA   NşA

									NNşB   Nb
									NNb    Nb
								)
							)
						);cond
					)
				);cond

				;(IF (> NşB (* 2 (/ (LENGTH LIS-PB) DIVI)))  (SETQ Wb nil))			; SALIDA DE WHILE Wb

				;(IF (> NşB (LENGTH LIS-PB))  (SETQ Wb nil))					; SALIDA DE WHILE Wb

			) ; While Wb




			;	CONDICIONES																				

			(COND
				( (= NşA 10) (SETQ  Na1-A2 PT-A2   Nb1-00 PT-00   Nb1-B2 PT-B2   Na1-NşA NNşA   Nb1-NşB NNşB ) ) ; con1
				( (= NşA 11) (SETQ  Na2-A2 PT-A2   Nb2-00 PT-00   Nb2-B2 PT-B2   Na2-NşA NNşA   Nb2-NşB NNşB ) ) ; con2
				( (> NşA 11) (SETQ  Na3-A2 PT-A2   Nb3-00 PT-00   Nb3-B2 PT-B2   Na3-NşA NNşA   Nb3-NşB NNşB )

						(SETQ 3A1  Na2-A2 )
						(SETQ 3A2  Na3-A2 )

						(IF (AND (EQUAL Nb1-00 Nb2-00 0.00001) (EQUAL Nb1-B2 Nb2-B2 0.00001))

							(SETQ 3B1  Nb2-B2)

							(SETQ 3B1 (INTERS  Nb1-00 Nb1-B2   Nb2-00 Nb2-B2  nil))
						) ; if

						(IF (AND (EQUAL Nb2-00 Nb3-00 0.00001) (EQUAL Nb2-B2 Nb3-B2 0.00001))

							(SETQ 3B2  Nb3-B2)

							(SETQ 3B2 (INTERS  Nb2-00 Nb2-B2   Nb3-00 Nb3-B2  nil))
						) ; if


						;(COMMAND "COLOR" 2 "3DCARA" 3A1 3A2 3B2 3B1 "")

						(COND ( (= (INTERS 3A1 3B1 3A2 3B2 nil) nil) (PROMPT " CARA NO PLANA ") (TERPRI) ) );cond



						;(PROMPT " Na1-NşA= ") (PRIN1 Na1-NşA)
						;(PROMPT " Na2-NşA= ") (PRIN1 Na2-NşA)
						(PROMPT "  Na3-NşA = ") (PRIN1 Na3-NşA)

						;(PROMPT " Nb1-NşB= ") (PRIN1 Nb1-NşB)
						;(PROMPT " Nb2-NşB= ") (PRIN1 Nb2-NşB)
						(PROMPT "  Nb3-NşB = ") (PRIN1 Nb3-NşB)

						(PROMPT "  DIS-B1-B2 = ") (PRIN1 (DISTANCE 3B1 3B2)) (TERPRI)


						(COND
							( (EQUAL 3B1 3B2 0.00001) 		(PROMPT "    3B1 3B2  (SON IGUALES) ") (TERPRI) (SETQ COLO 3) )

							( (/= (INTERS 3A1 3B1 3A2 3B2) nil) (PROMPT "    *** CARA (CRUZADA) *** ") (TERPRI) (SETQ COLO 7) )

							(  T  (SETQ COLO 2) )
						);cond


						(COND
							(  (AND (< (DISTANCE 3B1 3B2) (* MODU 3.0)) (>= Nb3-NşB  Nb2-NşB) )

								(PINTA-3D-2D)

								(SETQ Na2-A2   Na3-A2

									Nb1-00   Nb2-00
									Nb1-B2   Nb2-B2
									Nb2-00   Nb3-00
									Nb2-B2   Nb3-B2

									Nb2-NşB  Nb3-NşB )
							)

							(  T
								(SETQ Na2-A2   Na3-A2

									Nb1-00   Nb2-00
									Nb1-B2   Nb2-B2
									Nb2-00   Nb3-00
									Nb2-B2   Nb3-B2

									Nb2-NşB  Nb3-NşB )	
							)
						); cond
				) ; con3
			) ;cond


			(SETQ Nb (- NNb (/ (LENGTH LIS-PB) DIVI )))				; RETROCEDE Nb => ((Nş-Puntos LIS-PB) / DIVI)

		) ; repeat									; *** *** REPEAT-LIS-PA

		(TERPRI)
		(SETQ NW1 (GETSTRING "QUIERE SEGUIR (S) o N : "))
		(IF (EQUAL NW1 "N") (SETQ W1 nil) (SETQ W1 T))

	) ;CIERRE WHILE W1
  
	;																								

	;	PARANDO																						
	(SETVAR "blipmode" 1) (SETVAR "cmdecho" 1)
) ;CIERRE DEFUN PIEL-03
;=====================================================================================================================================================



