id
int64
0
45.1k
file_name
stringlengths
4
68
file_path
stringlengths
14
193
content
stringlengths
32
9.62M
size
int64
32
9.62M
language
stringclasses
1 value
extension
stringclasses
6 values
total_lines
int64
1
136k
avg_line_length
float64
3
903k
max_line_length
int64
3
4.51M
alphanum_fraction
float64
0
1
repo_name
stringclasses
779 values
repo_stars
int64
0
882
repo_forks
int64
0
108
repo_open_issues
int64
0
90
repo_license
stringclasses
8 values
repo_extraction_date
stringclasses
146 values
sha
stringlengths
64
64
__index_level_0__
int64
0
45.1k
exdup_ids_cmlisp_stkv2
sequencelengths
1
47
35,385
fibonacci.lisp
yangby_template-commonlisp-project/t/fibonacci.lisp
#| Copyright (C) 2018 YangBy <[email protected]> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. |# (defpackage fibonacci-test (:use :cl :fib :5am) (:export :fibonacci-suite)) (in-package :fibonacci-test) (5am:def-suite fibonacci-suite :description "A suite for fibonacci numbers") (5am:in-suite fibonacci-suite) (5am:test fibonacci "Test for fibonacci numbers." (is (= 0 (fibonacci 0)) "fibonacci(0) = 0") (is (= 1 (fibonacci 2)) "fibonacci(2) = 1") (is (= 3 (fibonacci 4)) "fibonacci(4) = 3") (is (= 21 (fibonacci 8)) "fibonacci(8) = 21") (is (= 987 (fibonacci 16)) "fibonacci(16) = 987") (is (= 2178309 (fibonacci 32)) "fibonacci(32) = 2178309"))
1,272
Common Lisp
.lisp
29
41.448276
76
0.730583
yangby/template-commonlisp-project
0
0
0
AGPL-3.0
9/19/2024, 11:44:08 AM (Europe/Amsterdam)
5bee6939e1991d4bfb9dcbbdc8778509c14d635da779f27a4c8d869c8add35af
35,385
[ -1 ]
35,386
fibonacci-test.asd
yangby_template-commonlisp-project/fibonacci-test.asd
#| Copyright (C) 2018 YangBy <[email protected]> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. |# (defsystem fibonacci-test :author "YangBy <[email protected]>" :license "AGPLv3" :depends-on (:fibonacci :fiveam) :components ((:module "t" :serial t :components ((:file "fibonacci")))))
925
Common Lisp
.asd
21
40.238095
75
0.741111
yangby/template-commonlisp-project
0
0
0
AGPL-3.0
9/19/2024, 11:44:08 AM (Europe/Amsterdam)
66410d6f6ca82a005392362d752346a0544e002121656788cb4081d1e0f8f423
35,386
[ -1 ]
35,387
fibonacci.asd
yangby_template-commonlisp-project/fibonacci.asd
#| Copyright (C) 2018 YangBy <[email protected]> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. |# (defsystem fibonacci :author "YangBy <[email protected]>" :maintainer "YangBy <[email protected]>" :license "AGPLv3" :version (:read-file-form "version.sexp") :components ((:module "src" :serial t :components ((:file "package") (:file "fibonacci" :depends-on ("package"))))) :description "Fibonacci numbers." :long-description #.(uiop:read-file-string (uiop:subpathname *load-pathname* "README.md")))
1,162
Common Lisp
.asd
26
40.384615
75
0.725265
yangby/template-commonlisp-project
0
0
0
AGPL-3.0
9/19/2024, 11:44:08 AM (Europe/Amsterdam)
5a9a249dfb8d7180c4c2ff86918fc2f8650d9b85a1fe2a9ec7717b293c80074d
35,387
[ -1 ]
35,390
Makefile
yangby_template-commonlisp-project/Makefile
ROSWELL = ros RM = rm -f test: ${ROSWELL} run -l run-tests.lisp clean: -find . -type f -name "*.fasl" | xargs -I {} ${RM} {}
129
Common Lisp
.l
6
19.833333
54
0.595041
yangby/template-commonlisp-project
0
0
0
AGPL-3.0
9/19/2024, 11:44:08 AM (Europe/Amsterdam)
cdcdd0cd000df57b8bcd2c4720cedec5b1f0c15d8059f226d7b73e244103a563
35,390
[ -1 ]
35,391
.travis.yml
yangby_template-commonlisp-project/.travis.yml
sudo: false language: generic notifications: email: false git: depth: 5 cache: directories: - ${HOME}/.roswell - ${HOME}/.config/common-lisp addons: apt: packages: - libc6-i386 - default-jre env: matrix: - LISP=sbcl-bin - LISP=abcl - LISP=allegro - LISP=ccl - LISP=clasp - LISP=clisp - LISP=cmu - LISP=ecl - LISP=mkcl matrix: allow_failures: - env: LISP=abcl - env: LISP=allegro - env: LISP=ccl - env: LISP=clasp - env: LISP=clisp - env: LISP=cmu - env: LISP=ecl - env: LISP=mkcl install: - export ROSWELL_BRANCH=release - export ROSWELL_INSTALL_DIR=${HOME}/.roswell - export PATH=${ROSWELL_INSTALL_DIR}/bin:${PATH} - travis_retry curl -L https://raw.githubusercontent.com/roswell/roswell/${ROSWELL_BRANCH}/scripts/install-for-ci.sh | sh before_script: - ros version - ros config script: - make test
918
Common Lisp
.l
46
16.391304
123
0.658257
yangby/template-commonlisp-project
0
0
0
AGPL-3.0
9/19/2024, 11:44:08 AM (Europe/Amsterdam)
e0ea9f3ef26eb90f69e9615b7da529ebd1dd8d1a60bf7b2df8920bcea743ad2a
35,391
[ -1 ]
35,409
calc.lisp
shepherdjerred-homework_calc/src/calc.lisp
; Jerred Shepherd (defun calc (x) (let ((operator (second x)) (left (first x)) (right (third x))) (let ((l (if (listp left) (calc left) left)) (r (if (listp right) (calc right) right))) (apply operator l r nil)))) ; (calc '(1 + 2)) ; => 3 ; (calc '(2 * (1 + 2))) ; => 6 ; (calc '((5 + 1) / (4 - 2))) ; => 3
430
Common Lisp
.lisp
15
20.666667
36
0.384988
shepherdjerred-homework/calc
0
0
0
GPL-3.0
9/19/2024, 11:44:08 AM (Europe/Amsterdam)
de5335c6aa793cee925b94d505c5f3e2cf8d583543f32bcfea5372d4a40db473
35,409
[ -1 ]
35,426
guessmynumber.lisp
AbhijeetO_LandoLisp/guessmynumber/guessmynumber.lisp
(defparameter *small* 1) (defparameter *big* 100) (defun guessmynumber() (ash (+ *small* *big*) -1)) (defun smaller () (setf *big* (1- (guessmynumber))) (guessmynumber)) (defun bigger () (setf *small* (1+ (guessmynumber))) (guessmynumber)) (defun start-over () (defparameter *small* 1) (defparameter *big* 100) (guessmynumber))
344
Common Lisp
.lisp
14
22.428571
37
0.672727
AbhijeetO/LandoLisp
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
c9aff3b886bc936a914e7fdc93ef93f63cd00fce42637201550ef51a16d79eb0
35,426
[ -1 ]
35,443
turing.lisp
Hector93_turing-machine-lisp/turing.lisp
(defparameter *cinta* nil) (defparameter *Q* '()) ;states (defparameter *blank* nil) (defparameter *Q0* nil) ;initial state (defparameter *F* nil) ;final state (defparameter *cabeza* nil);head (defun knownState() "starts the variables for the turing machine" (setq *cinta* '(1)) (setq *Q* '((A (0 - R C) (1 X R B) (X - L A)) (B (0 X L A) (1 - R B) (X - R B)) (C (0 - R D) (X 1 R C)) (D ) ) ) (setq *Blank* '0) (setq *Q0* 'A) (setq *F* '(D)) (setq *cabeza* 0) ) (defun reset-all() (setq *cinta* '()) (setq *cabeza* '()) ) (defun getOp(cabeza) "gets the operation that will execute" (let ((aux 1) (operacion nil) ) (loop for x in *Q* while (= aux 1) if (equalp *Q0* (car x)) do ;(format t "~A~%" (rest x)) (loop for y in (cdr x) while (= aux 1) if (equal (car y) cabeza) do ;(format t "~A~%" y) (setq aux 1) (setq operacion y) ) ) (rest operacion)) ) (defun aumentaCinta(direccion) "increases the tape of the machine to the left or right when is needed, this allows to have a very big tape" (cond ((equal direccion 'R) (setf *cinta* (append *cinta* (cons *Blank* nil)))) ((equal direccion 'L) (setf *cinta* (append (cons *Blank* nil) *cinta*))) ) ) (defun estadoFinal? (estado) "checks if the final state is reached" (let ((aux 1)) (loop for x in *F* while (= aux 1) if (equal estado x) do (setq aux 0) ) (cond ((equal 0 aux))) ) ) (defun aplicaOperacion(operacion) "aplies the operation" (cond ((not (equal '- (car operacion))) (setf (nth *cabeza* *cinta*) (car operacion))) ) (cond ((equal (cadr operacion) 'R) (cond ((>= (1+ *cabeza*) (length *cinta*)) (aumentacinta 'R) (setq *cabeza* (1+ *cabeza*))) (t (setq *cabeza* (1+ *cabeza*))) ) ) ((equal (cadr operacion) 'L) (cond ((= *cabeza* 0) (aumentacinta 'L)) (t (setq *cabeza* (1- *cabeza*))) ) ) ) (setq *Q0* (caddr operacion)) ) (defun turing() "main function" (let ((tempOp nil)) (loop while (not (estadoFinal? *Q0*)) do(setq tempOp (getOp (nth *cabeza* *cinta*))) (format t "q0:~A, op:~A, cinta:~A" *Q0* tempOp *cinta* ) (aplicaOperacion tempOp) (format t " -> res: ~A~%" *cinta*);(read-char) ) ) ) (knownState) (turing )
2,350
Common Lisp
.lisp
87
23.022989
110
0.571492
Hector93/turing-machine-lisp
0
0
0
GPL-2.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
31f5c1066a79fc10627be24e27ce1457ad188e2446ea67f89729e9c5d728a242
35,443
[ -1 ]
35,460
queens.lisp
la3lma_fun-with-lisp/queens.lisp
;;; ;;; The 8 queens problem, just as a kata :-) ;;; ;; XXX NOTE: THis thing makes _some_ correct solutions, not yet verified that it does all. (defun all-permutations (list) "Generate all permutations of the elements in a list" (cond ((null list) nil) ((null (cdr list)) (list list)) (t (loop for element in list append (mapcar (lambda (l) (cons element l)) (all-permutations (remove element list))))))) (defun solutionp (candidate) "Looking for queens on diagonals, true iff not found" (if (null candidate) (return-from solutionp t) (let ((h (car candidate)) (o 1)) (dolist (tl (cdr candidate)) (if (= (abs (- tl h)) o) (return-from solutionp nil)) (incf o)))) (solutionp (cdr candidate))) (defun 8q () "Naive implementation, not removing any symmetries, finding all 92 possible solutions." (remove-if-not #'solutionp (all-permutations (list 0 1 2 3 4 5 6 7)))) (defun uq8 () "Find the 12 essential solutions to the eight queen problem" (symmetry-zapper (8q))) (defun remove-symmetries (symmetry-generators candidates) "Very bogus function, does not work yet" (let ((result '())) (dolist (candidate candidates) (block candidate-loop (dolist (symmetry-generator symmetry-generators) (let ((symmetry (apply symmetry-generator (list candidate)))) (when (member symmetry result :test #'equal) (return-from candidate-loop)))) (setq result (cons candidate result)))) result)) (defun symmetry-zapper (candidates) (remove-symmetries (list #'rotation90 #'rotation180 #'rotation270 #'mirror-horizontal #'mirror-vertical #'mirror-diagonal1 #'mirror-diagonal2) candidates)) ;; The three essential symmetries (defun symmetry-builder (candidate index-calculator) (let ((v (make-array 8))) (dotimes (x 8) (let ((y (nth x candidate))) (setf (aref v (apply index-calculator (list y))) x))) (list (aref v 0) (aref v 1) (aref v 2) (aref v 3) (aref v 4) (aref v 5) (aref v 6) (aref v 7)))) (defun rotation90 (candidate) (symmetry-builder candidate #'(lambda (y) (- 7 y)))) (defun mirror-diagonal1 (candidate) (symmetry-builder candidate #'(lambda (y) y))) (defun mirror-horizontal (candidate) (reverse candidate)) ;; The remaining symmetries are constructed by composing ;; the essential symmetries in various ways (defun rotation180 (candidate) (rotation90 (rotation90 candidate))) (defun rotation270 (candidate) (rotation180 (rotation90 candidate))) (defun mirror-diagonal2 (candidate) (rotation90 (mirror-diagonal1 (rotation-90 candidate)))) (defun rotation-90 (candidate) (rotation270 candidate)) (defun mirror-vertical (candidate) (rotation90 (mirror-horizontal (rotation-90 candidate)))) ;; ;; Pretty printg chessboards ;; (defun repeat-string (ch l) (with-output-to-string (str) (dotimes (i l) (format str "~c" ch)))) (defun pp (board &key (out *standard-output*)) "Pretty print chess boards for the 8 queens problem" (format out "~%+--------+") (dolist (piece board) (let ((pre (repeat-string #\ (- piece 0))) (post (repeat-string #\ (- 7 piece)))) (format out "~%|~a*~a|" pre post))) (format out "~%+--------+"))
3,239
Common Lisp
.lisp
93
31.311828
90
0.684615
la3lma/fun-with-lisp
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
d6f50f8493fad95e85568c546d76056d835dd3712f4f9853a1d4fc417a95a34d
35,460
[ -1 ]
35,477
encoder.lisp
Three-Winters_lisp-shellcode-tools/encoder.lisp
;;;; This file is for encoding shellcode using a XOR encoder or custom encoder. (ql:quickload :cl-ppcre) ;; Put your shellcode down in this variable. (defparameter *shellcode* "") (setf *print-base* 16) (setf *read-base* 16) (defun write-data (lst) "Debug, for printing internal data" (format t "~x" lst)) (defun encoder-func (lst ixor func) "A function that calls a function (the encoder itself) to transform data" (labels ((fn (lst xlst) (if (not (equal lst 'nil)) (progn (let ((byte (funcall func (car lst) ixor))) (fn (cdr lst) (cons (abs byte) xlst)))) (nreverse xlst)))) (fn lst 'nil))) (defun string-to-list (str) "Turn a string of characters into a list" (if (not (streamp str)) (string-to-list (make-string-input-stream str)) (if (listen str) (cons (read str) (string-to-list str)) 'nil))) (defun make-list-from-shellcode (str) "Takes the usual C \x00 codes and turns them into a lisp list" (string-to-list (cl-ppcre:regex-replace-all "x" str " "))) (defun write-shellcode-to-file (bytes filepath) "Writes the new encoded shellcode into a binary file, ready to be read or inserted" (with-open-file (file filepath :direction :output :element-type 'unsigned-byte :if-exists :append :if-does-not-exist :create) (dolist (segment bytes) (write-byte segment file)))) (defun xor-encode (ixor filename) "XOR encoder" (write-shellcode-to-file (encoder-func (make-list-from-shellcode *shellcode*) ixor #'logxor) filename)) (defun not-encode (inot filename) "NOT encoder. It also does NOT work right." (write-shellcode-to-file (encoder-func (make-list-from-shellcode *shellcode*) inot #'lognor) filename)) (defun read-bin (filename) "Read a binary and print the values, C-style." (with-open-file (file filename :direction :input :element-type 'unsigned-byte) (loop :do (let ((byt (read-byte file 'nil))) (if (equal byt 'nil) (return) (format t "\\x~x" byt)))))) (defun read-bin-array (filename) (with-open-file (file filename :direction :input :element-type 'unsigned-byte) (loop :do (let ((byt (read-byte file 'nil))) (if (equal byt 'nil) (return) (format t "0x~x," byt))))))
2,243
Common Lisp
.lisp
55
36.727273
104
0.678309
Three-Winters/lisp-shellcode-tools
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6ea4518ebe1c597d364084f59c7accb0e371e729a38844c13d01ae9221d5ee51
35,477
[ -1 ]
35,478
lmutate.lisp
Three-Winters_lisp-shellcode-tools/lmutate.lisp
;;;; This file is for replacing instructions before assembly with equivalent ones to avoid fingerprinting ;;;; (i.e. shellcode polymorphism) ;;;; Only supports intel nasm syntax. ;; address of the E of magic bytes in ELF executables for interesting stuff. (defparameter *magic-address* "0x400000") (ql:quickload :cl-utilities) (setf *print-base* 16) (setf *read-base* 16) (defparameter *polymorphs* '(("nop" . '("xchg ax,ax~%" "xchg rax,rax~%" "nop";end one/two byte safe nops "nop dword [rax]~%" "nop dword [rax+rax]~%" "nop word [rax+rax]~%" "push rax~%pop rax~%" "inc rax~%dec rax~%" "inc rbx~%dec rbx~%")) ("xor rax, rax" . '("sub rax,rax~%" "mov r10,rax~%sub rax,r10~%" "mov rax,[~a]~%sub rax,0x7f~%" )))) ;;(cdr (assoc "nop" *polymorphs* :test #'string=)) ;;(nth (random length) list) (defun magic-math (result) "Obfuscates any obvious values passed to registers by using an address to do arithmetic" (let ((x (- result 7f))) (if (<= x 0) (format t "sub ~a, 0x7f~%" (abs x)) (format t "add ~a, 0x7f~%" x)))) (defun string-split (str) "Splits a string. Fancy." (cl-utilities:split-sequence #\Space str)) (defun de-white (str) "Removes whitespace from strings" (string-trim '(#\Space #\Newline #\Backspace #\Tab #\Linefeed #\Page #\Return #\Rubout) str)) (defun open-file (fpath) "Opens the source assembly code file to polymorph" (let ((in (open fpath :if-does-not-exist nil))) (when in (loop :for line = (read-line in nil) while line do (progn (let* ((x (caddr (assoc (de-white line) *polymorphs* :test #'string=))) (y (nth (random (1+ (length x))) x))) (if (not (string= y nil)) (progn (format t y *magic-address*)) (format t "~a~%" line))))) (close in))))
2,070
Common Lisp
.lisp
51
31.647059
105
0.552434
Three-Winters/lisp-shellcode-tools
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6f6e6b487372879d749f97524568acff5def0de448f9a1217b1d3904ec68bcc0
35,478
[ -1 ]
35,481
make-shellcode.sh
Three-Winters_lisp-shellcode-tools/make-shellcode.sh
#!/bin/bash #objdumps .text section of an object in C-style escaped values. E_WRONG_ARGS=3 num_expected_args=1 if [ $# -ne $num_expected_args ] then echo "Usage: `basename $0` object_file" exit $E_WRONG_ARGS fi for i in $(objdump -d $@ |grep "^ " |cut -f2); do echo -n '\x'$i; done; echo
297
Common Lisp
.l
13
21.153846
63
0.682143
Three-Winters/lisp-shellcode-tools
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
4f7152973413980c78c49d6abde653f484df23b0ef2492c6ed8b040269ad32cd
35,481
[ -1 ]
35,497
main.lisp
rvedam_cl-solid/main.lisp
(in-package #:cl-user) (defpackage #:cl-solid (:use #:cl #:cl-solid/src/util #:cl-solid/src/config #:cl-solid/src/web #:cl-solid/src/view #:cl-solid/src/db #:cl-solid/src/authentication #:cl-solid/src/make ) (:import-from :cl-solid/src/config :config) (:import-from :clack :clackup) (:export :start :stop :sparql-query :sparql-values :getk ) ) (in-package :cl-solid) (defvar *appfile-path* (asdf:system-relative-pathname :cl-solid #P"app.lisp")) (defvar *handler* nil) (defun start (&rest args &key server port debug &allow-other-keys) (declare (ignore server port debug)) (when *handler* (restart-case (error "Server is already running.") (restart-server () :report "Restart the server" (stop)))) (setf *handler* (apply #'clackup *appfile-path* args))) (defun stop () (prog1 (clack:stop *handler*) (setf *handler* nil)))
958
Common Lisp
.lisp
39
20.076923
66
0.633078
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
b36b31e679eccec5d1ddebf516d9431280a11a222e12bb0adc61a5964f987323
35,497
[ -1 ]
35,498
app.lisp
rvedam_cl-solid/app.lisp
(ql:quickload :cl-solid) (defpackage cl-solid/app (:use :cl :cl-solid/src/util ) (:import-from :lack.builder :builder) (:import-from :ppcre :scan :regex-replace) (:import-from :cl-solid/src/web :*web*) (:import-from :cl-solid/src/config :config :productionp :*static-directory*)) (in-package :cl-solid/app) (builder (:static :path (lambda (path) (if (ppcre:scan "^(?:/images/|/css/|/js/|/robot\\.txt$|/favicon\\.ico$)" path) path nil)) :root *static-directory*) (if (productionp) nil :accesslog) (if (getf (config) :error-log) `(:backtrace :output ,(getf (config) :error-log)) nil) :session (if (productionp) nil (lambda (app) (lambda (env) (let ((datafly:*trace-sql* t)) (funcall app env))))) (clath:component (getk :domain (config :server))) *web*)
990
Common Lisp
.lisp
40
17.775
88
0.53692
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
8f1d08b4cfd82d8f7723d040aebe3f66157e50b404b022903f1d746083692248
35,498
[ -1 ]
35,499
db.lisp
rvedam_cl-solid/src/db.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/db (:use :cl :cl-solid/src/util ) (:import-from :cl-solid/src/config :config) (:import-from :dexador) (:export :connection-settings :db :with-connection :sparql-query :sparql-values :create-triple :delete-triple :create-new-id :get-typed-literal )) (in-package :cl-solid/src/db) (defun connection-settings (&optional (db :maindb)) (cdr (assoc db (config :databases)))) (defun db (&optional (db :maindb)) (apply #'connect-cached (connection-settings db))) (defmacro with-connection (conn &body body) `(let ((*connection* ,conn)) ,@body)) ;;graphdb - tested for Allegrograph (defun get-agent-iri () (if (config :namespace) (string+ "<" (config :namespace) "1>") (progn (format t "~%ERROR: Need to Configure :namespace in :cl-solid/src/util") nil))) (defun get-lock-iri () (if (config :namespace) (string+ "<" (config :namespace) "2>") (progn (format t "~%ERROR: Need to Configure :namespace in :cl-solid/src/util") nil))) (defparameter *agent* (get-agent-iri) "IRI for the main Solid agent managing all PODs in this repository") (defparameter *lock* (get-lock-iri) "IRI for the lock used to prevent mutliple id writes at the same time") (defun initiate-solid () (when (not (sparql-values (string+ "select ?o where { " *agent* " " (config :p.type) "?o .}"))) (create-triple *agent* (config :p.type) (config :e.agent)) (create-triple *agent* (config :p.label) (config :agent-name)) (create-triple *agent* (config :p.id) "2" :typed "<http://www.w3.org/2001/XMLSchema#int>" ) (create-triple lock (config :p.type) (config :e.progress-code) ) (create-triple lock (config :p.label) "Locked"))) (defun get-current-id () (let ((values (sparql-values (string+ "select ?o where {" *agent* (config :p.id) " ?o}")))) (when values (get-object (caar values))))) (defun create-new-id () (let* ((IRI (create-new-ids)) (IRI (if (listp IRI)(car IRI) nil))) IRI)) (defun create-new-ids (&optional qty) ;;TODO write in lock function to prevent overlapping id requests (let* ((current-id (get-current-id)) (id-list nil) (qty (if qty qty 1)) ) (dotimes (i qty)(setf id-list (cons (+ 1 i current-id) id-list))) (when id-list (let* ((result (write-new-id (first id-list) current-id 0)) (result-lisp (if (or (stringp result)(string= (type-of result) "BOOLEAN")) result (json->lisp result))) (final (if (equal result-lisp T) (reverse id-list) result-lisp))) (if final (mapcar #'(lambda(x)(string+ "<" (config :namespace) (write-to-string x) ">")) final)) )))) (defun write-new-id (int current-id iteration) (if (eq iteration 5) (progn ;TODO trigger email notification or other that this happened (sleep 1) (write-new-id int current-id 0) ) (let ((iteration (+ iteration 1))) (if (?locked) (write-new-id int current-id iteration) (when (integerp int) (lock-agent) (create-triple *agent* (config :p.id) (write-to-string int) :typed :int) (delete-triple *agent* (config :p.id) (write-to-string current-id) :typed :int) (unlock-agent) ))))) (defun ?locked () (let ((locked (sparql-values (string+ "select ?l where { " *agent* " " (config :p.status) " ?l .}")))) (if locked (when (string= (caar locked) *lock*) t) ))) (defun lock-agent () (if (not (?locked)) (let ((result (create-triple *agent* (config :p.status) *lock*))) result ))) (defun unlock-agent () (if (?locked) (let ((result (delete-triple *agent* (config :p.status) *lock*))) result ))) (defun create-triple (subject predicate object &key (graph *agent*) typed) (modify-triple subject predicate object :graph graph :typed typed :action "INSERT")) (defun delete-triple (subject predicate object &key (graph *agent*) typed) (modify-triple subject predicate object :graph graph :typed typed :action "DELETE")) (defun modify-triple (subject predicate object &key (graph *agent*) typed action) (let ((subject (get-iri subject)) (predicate (get-iri predicate)) (object (if typed (get-typed-literal object typed) (if (?iri object) object (if (?uri object) (get-iri object) (if (stringp object) (string+ "\"" object "\"")))))) (graph (if (?iri graph) graph (get-iri graph)))) (when (and subject predicate object graph) (let ((result (sparql-query (string+ action " DATA { GRAPH " graph " { " subject " " predicate " " object " .} }")))) (when result (json-string->list result)))))) (defmethod get-typed-literal ((item string)(type string)) (when (and (stringp item) (member type (get-pl-values (config :xsd)) :test #'string=)) (string+ "\"" item "\"^^" type) )) (defmethod get-typed-literal ((item string)(type symbol)) (get-typed-literal item (getf (config :xsd) type ))) (defun get-object (item) (let ((parse (split-string #\^ item))) (if (= (length parse) 3) (let ((object (first parse)) (type (third parse))) (cond ((string= type (getf (config :xsd) :int)) (parse-integer (second (split-string #\" object)))) )) item ))) (defun sparql-query (query) "this will take any query as a string and send to server" (let* ((repository (string+ (config :domain) ":" (config :port) (config :repository))) ) (handler-case (multiple-value-bind (result http-status response-hash uri stream) (dex:post repository :basic-auth `(,(config :user) . ,(config :password)) :headers (list '("content-type"."application/sparql-query") '("charset"."utf-8") '("accept"."application/json") ) :content query ) (declare (ignore http-status response-hash uri)) (close stream) result) (error (err) (process-error err))))) (defun sparql-values (query) (let ((result (sparql-query query))) (if (stringp result) (cdr (assoc :values (json-string->list result))))))
6,040
Common Lisp
.lisp
165
32.363636
121
0.641868
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
3bc58f71ea19f33dfd80887f2832a8f0a84f03b19cf7cc723c547d582aa2ae86
35,499
[ -1 ]
35,500
util.lisp
rvedam_cl-solid/src/util.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/util (:use :cl :cl-json :alexandria :babel :quri ) (:export :plist->json :json->plist :json->lisp :json-string->plist :json-string->list :split-string :string+ :getk :process-error :?uri :?iri :get-iri :get-uri :get-pl-values ) ) (in-package :cl-solid/src/util) (defun getk (key conf) (cdr (assoc key conf))) (defun url-encode? (item) (when (stringp item) (let* ((decode (quri:url-decode item)) (encode (string-encode decode))) (when (string= item encode) t)))) (defun plist->json (plist) (json:encode-json-plist-to-string plist)) (defun json->plist (json) (json-string->plist (map 'string 'code-char json))) (defun json-string->plist (json-string) (alexandria:alist-plist (json:decode-json-from-string json-string))) (defun json-string->list (json-string) (json:decode-json-from-string json-string)) (defun json->lisp (octets) (let ((response-string (babel:octets-to-string octets))) (json:decode-json-from-string response-string))) (defun split-string (char string) "Returns a list of substrings of string divided by ONE space each. Note: Two consecutive spaces will be seen as if there were an empty string between them." (loop for i = 0 then (1+ j) as j = (position char string :start i) collect (subseq string i j) while j)) (defun string+ (&rest strings) (apply #'concatenate 'string strings)) (defmethod process-error ((err string)) (string+ "Error:" err)) (defmethod process-error ((err t)) err) (defmethod ?uri ((item quri.uri:uri)) (let* ((scheme (quri:uri-scheme item)) (host (quri:uri-host item)) (dhost (if host (split-string #\. host)))) (when (and (member scheme '("http" "https") :test #'string=) (and (> (length dhost) 1)(> (length (car (last dhost))) 1))) t))) (defmethod ?uri ((item string)) (?uri (quri:uri item))) (defmethod ?uri ((item t)) nil) (defmethod ?iri ((item string)) (when (and (string= (subseq item 0 1) "<") (string= (subseq item (- (length item) 1) (length item)) ">") (?uri (subseq item 1 (- (length item) 1)))) t)) (defmethod ?iri ((item t)) nil) (defmethod get-iri ((item string)) (if (?iri item) item (if (?uri item) (string+ "<" item ">")))) (defmethod get-iri ((item quri.uri:uri)) (get-iri (quri:render-uri item))) (defmethod get-iri ((item t)) nil) (defmethod get-uri ((item quri.uri:uri)) (quri:render-uri item)) (defmethod get-uri ((item string)) (cond ((?uri item) item) ((?iri item) (string-trim '(#\< #\>) item)))) (defmethod get-uri ((item t)) nil) (defmethod get-pl-values ((property-list cons)) "Returns just the values of the property list as a list, skipping the keys" (let ((result)) (dotimes (pv (/ (length property-list) 2)) (setf result (cons (nth (+ (* pv 2) 1) property-list) result))) result )) (defmethod get-pl-values ((property-list t)) nil)
3,026
Common Lisp
.lisp
106
24.981132
77
0.647323
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
2e7c902a899df20652a9ba7749a121850727dd621d5371ebcfe623bf31d1c33f
35,500
[ -1 ]
35,501
make.lisp
rvedam_cl-solid/src/make.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/make (:use :cl :cl-solid/src/db :cl-solid/src/util ) (:import-from :cl-solid/src/config :config) (:export :make-webid :make-agent )) (in-package :cl-solid/src/make) ;;NOTE: This implementation is using the web-id as a named graph for all triples related to that web-id for easy full graph retrieval (defun make-webid (&key agent name image nickname key container) "minimum required webid: webid is instance of e.personal-profile-document, has p.primary-topic with a valid Agent type" (let* ((webid (create-new-id)) (agent (when webid (if (get-iri agent) (get-iri agent) (when name (make-agent name :image image :nickname nickname :key key :container container :graph webid)))))) (when (and agent webid) (create-triple webid (config :p.label) (get-uri webid) :graph webid :typed (config :xsd-string)) (create-triple webid (config :p.type) (config :e.personal-profile-document) :graph webid) (create-triple webid (config :p.primary-topic) agent :graph webid) webid ))) (defmethod make-agent ((name string) &key (type (config :e.person)) image nickname key container graph) "minimum agent: p.name. Note: this function should typically not be run directly to get the web-id iri as graph value on first creation" (when (and name (config :agent-name) graph) (let ((type (get-iri type))) (when (member type (list (config :e.person) (config :e.group) (config :e.organization)) :test #'string=) (let ((agent-id (create-new-id)) (cont (if (get-iri container) (get-iri container) (make-container :graph graph) ))) (create-triple agent-id (config :p.type) type :graph graph) (create-triple agent-id (config :p.storage) cont :graph graph) (create-triple agent-id (config :p.name) name :graph graph) (create-triple agent-id (config :p.label) name :graph graph) (when (get-iri image) (create-triple agent-id (config :p.image) (get-iri image) :graph graph)) (when (stringp nickname) (create-triple agent-id (config :p.nickname) nickname :graph graph)) (when (get-iri key) (create-triple agent-id (config :p.key) (get-iri key) :graph graph)) agent-id ))))) ;;Containers: https://www.w3.org/TR/2015/REC-ldp-20150226/ (defun make-container (&key (type (config :e.basic-container)) (label (config :agent-name)) graph) (let ((container (create-new-id))) (when container (create-triple container (config :p.type) type :graph graph) (create-triple container (config :p.label) label :graph graph) container )))
2,633
Common Lisp
.lisp
54
44.111111
138
0.691738
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
788f1913712fe4864e38bbb91cdd0af8834503429a9b17e8f2d8d480b4008363
35,501
[ -1 ]
35,502
view.lisp
rvedam_cl-solid/src/view.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/view (:use :cl) (:import-from :cl-solid/src/config :*template-directory*) (:import-from :caveman2 :*response* :response-headers) (:import-from :djula :add-template-directory :compile-template* :render-template* :*djula-execute-package*) (:import-from :datafly :encode-json) (:export :render :render-json)) (in-package :cl-solid/src/view) (djula:add-template-directory *template-directory*) (defparameter *template-registry* (make-hash-table :test 'equal)) (defun render (template-path &optional env) (let ((template (gethash template-path *template-registry*))) (unless template (setf template (djula:compile-template* (princ-to-string template-path))) (setf (gethash template-path *template-registry*) template)) (apply #'djula:render-template* template nil env))) (defun render-json (object) (setf (getf (response-headers *response*) :content-type) "application/json") (encode-json object)) ;; ;; Execute package definition (defpackage #:cl-solid/src/djula (:use :cl) (:import-from :cl-solid/src/config :config :appenv :developmentp :productionp) (:import-from :caveman2 :url-for)) (setf djula:*djula-execute-package* (find-package :cl-solid/src/djula))
1,498
Common Lisp
.lisp
43
27.023256
79
0.620594
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
dcbd945957349198e7ad1b838ba587ad584642f2d3697dcee2f3060239cfc33c
35,502
[ -1 ]
35,503
config.lisp
rvedam_cl-solid/src/config.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/config (:use :cl) (:import-from :envy :config-env-var :defconfig) (:export :config :*application-root* :*static-directory* :*template-directory* :appenv :developmentp :productionp)) (in-package :cl-solid/src/config) (setf (config-env-var) "APP_ENV") (defparameter *application-root* (asdf:system-source-directory :cl-solid)) (defparameter *static-directory* (merge-pathnames #P"static/" *application-root*)) (defparameter *template-directory* (merge-pathnames #P"templates/" *application-root*)) #| Example config :namespace "http://example.com/node#" ##This namespace should be the domain that your Solid service controls. cl-solid will automatically increment newly created graph node ids up from 1 using theis namespace starting with <http://example.com/node#1> in this example (defconfig |development| `(:domain "http://example.com" :port "10035" :repository "/repositories/Solid" :user "user" :password "password" :namespace "http://example.com/node#" :agent-name "Solid #1" :graphdb "Allegrograph" )) |# (defconfig :common `(:databases ((:maindb :sqlite3 :database-name ":memory:")) :e.agent "<http://xmlns.com/foaf/0.1/Agent>" :e.basic-container "<http://www.w3.org/ns/ldp#BasicContainer>" :e.group "<http://xmlns.com/foaf/0.1/Group>" :e.organization "<http://xmlns.com/foaf/0.1/Organization>" :e.person "<http://xmlns.com/foaf/0.1/Person>" :e.personal-profile-document "<http://xmlns.com/foaf/0.1/PersonalProfileDocument>" :e.progress-code "<http://def.seegrid.csiro.au/isotc211/iso19115/2003/metadata#ProgressCode>" :p.contains "<http://www.w3.org/ns/ldp#contains>" :p.id "<http://reference.data.gov.au/def/ont/iso19160-1-address#AddressableObject.id>" :p.image "<http://xmlns.com/foaf/0.1/img>" :p.key "<http://www.w3.org/ns/auth/cert#key>" :p.knows "<http://xmlns.com/foaf/0.1/knows>" :p.label "<http://www.w3.org/2000/01/rdf-schema#label>" :p.name "<http://xmlns.com/foaf/0.1/name>" :p.nickname "<http://xmlns.com/foaf/0.1/nick>" :p.primary-topic "<http://xmlns.com/foaf/0.1/primaryTopic>" :p.status "<http://def.seegrid.csiro.au/isotc211/iso19115/2003/metadata#status>" :p.storage "<http://www.w3.org/ns/pim/space#storage>" :p.type "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>" :xsd (:int "<http://www.w3.org/2001/XMLSchema#int>" :string "<http://www.w3.org/2001/XMLSchema#string>" ) )) (defconfig |development| '()) (defconfig |production| '()) (defconfig |test| '()) (defun config (&optional key) (envy:config #.(package-name *package*) key)) (defun appenv () (uiop:getenv (config-env-var #.(package-name *package*)))) (defun developmentp () (string= (appenv) "development")) (defun productionp () (string= (appenv) "production"))
2,992
Common Lisp
.lisp
70
37.685714
269
0.667588
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
7348f6c04fe602c60502553bbe5d52e85e322278bf19169af4f914a8f62fe283
35,503
[ -1 ]
35,504
authentication.lisp
rvedam_cl-solid/src/authentication.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/authentication (:use :cl :jose ) (:nicknames #:authenticate) (:export )) (in-package #:authenticate) ;;https://github.com/solid/webid-oidc-spec ;;https://github.com/BnMcGn/clath ;;
243
Common Lisp
.lisp
12
18.166667
42
0.71179
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
4ddbb6d28861b2d4068bf554faf0a1a9cf41af67fd10309e6b720120411cd383
35,504
[ -1 ]
35,505
web.lisp
rvedam_cl-solid/src/web.lisp
(in-package :cl-user) (defpackage #:cl-solid/src/web (:use :cl :caveman2 :cl-solid/src/config :cl-solid/src/view :cl-solid/src/db :datafly :sxql) (:export :*web*)) (in-package :cl-solid/src/web) ;; for @route annotation (syntax:use-syntax :annot) ;; ;; Application (defclass <web> (<app>) ()) (defvar *web* (make-instance '<web>)) (clear-routing-rules *web*) ;; ;; Routing rules (defroute "/" () (render #P"index.html")) ;; ;; Error pages (defmethod on-exception ((app <web>) (code (eql 404))) (declare (ignore app)) (merge-pathnames #P"_errors/404.html" *template-directory*))
662
Common Lisp
.lisp
28
19.642857
54
0.614035
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6aa52d382347e3dd4d3f436185859abcd3a19a498c224116700ecac322ca4252
35,505
[ -1 ]
35,506
cl-solid.lisp
rvedam_cl-solid/tests/cl-solid.lisp
(in-package :cl-user) (defpackage cl-solid-test (:use :cl :cl-solid :prove)) (in-package :cl-solid-test) (plan nil) ;; blah blah blah. (finalize)
167
Common Lisp
.lisp
9
15.222222
27
0.645161
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
36cf4b8ac6f6d063bc20a5fdb375ffdd22759355d1a169d2a84dfb9dd57d26e3
35,506
[ -1 ]
35,507
cl-solid-test.asd
rvedam_cl-solid/cl-solid-test.asd
(defsystem "cl-solid-test" :defsystem-depends-on ("prove-asdf") :author "Frederick C Gibson" :license "" :depends-on ("cl-solid" "prove") :components ((:module "tests" :components ((:test-file "cl-solid")))) :description "Test system for cl-solid" :perform (test-op (op c) (symbol-call :prove-asdf :run-test-system c)))
381
Common Lisp
.asd
11
28.090909
73
0.602703
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
55ab7774749ab2b1a27a04105c5dcac99cbdc121f072eed9f2a6cb374b2c7e41
35,507
[ -1 ]
35,508
cl-solid.asd
rvedam_cl-solid/cl-solid.asd
(defpackage cl-solid-asd (:use :cl :asdf)) (in-package :cl-solid-asd) (defsystem "cl-solid" :class :package-inferred-system :version "0.1.0" :author "Frederick C Gibson, Mark Watson" :license "GNU General Public License Version 3" :depends-on ("clack" "lack" "caveman2" "envy" "cl-ppcre" "uiop" ;; for @route annotation "cl-syntax-annot" ;; HTML Template "djula" ;; for DB "datafly" "sxql" "clath" "cl-solid/main" ) :description "Common Lisp library for the Solid framework: https://github.com/solid/solid-spec" :in-order-to ((test-op (test-op "cl-solid-test"))))
789
Common Lisp
.asd
26
20.692308
97
0.526385
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6457f689ce7ab006e17c8b1e91c51d71c6ff2201cacb39af715d5c53dc0a77f4
35,508
[ -1 ]
35,521
index.html
rvedam_cl-solid/templates/index.html
{% extends "layouts/default.html" %} {% block title %}Welcome to Caveman2{% endblock %} {% block content %} <div id="main"> Welcome to <a href="http://8arrow.org/caveman/">Caveman2</a>! </div> {% endblock %}
210
Common Lisp
.l
7
28.714286
63
0.665025
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6597b5705cef729b6679f77094987498c734ff0ffd8c4509e4620d324bcb82a3
35,521
[ -1 ]
35,522
default.html
rvedam_cl-solid/templates/layouts/default.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>{% block title %}{% endblock %}</title> <link rel="stylesheet" type="text/css" media="screen" href="/css/main.css"> </head> <body> {% block content %}{% endblock %} </body> </html>
249
Common Lisp
.l
11
20.909091
77
0.634454
rvedam/cl-solid
0
1
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
a345ffc53f07e818bff0b44b7e1b19dadb91475cfdf1a67417e9a1df2a51074a
35,522
[ -1 ]
35,539
test.lisp
shepherdjerred-homework_unify-function/test/test.lisp
(progn (load "../src/match.lisp") (load "../src/simplify.lisp") (load "../src/unify.lisp") (trace unify) (trace do-unify) (trace match) (trace simplify) (trace apply-subs) (trace apply-one-sub)) (and (equal (unify '(+ a b) '(+ a x)) '((X . B))) (equal (unify '(+ a b) '(x a b)) '((X . +))) (equal (unify '(+ (- b c) a) '(+ x y)) '((Y . A) (X - B C))) (equal (unify '(+ Y B) '(+ A X)) '((X . B) (Y . A))) (equal (unify '(* A Z) '(* Y Y)) '((Z . A) (Y . A))) (equal (unify '(+ (- B C) Y) '(+ X A)) '((Y . A) (X - B C))) (equal (unify '(+ Z (+ B A)) '(+ C (+ Y X))) '((X . A) (Y . B) (Z . C))) (equal (unify 'a 'a) '(nil)) (equal (unify 'b 'a) nil) (equal (unify '(a + b) '(a + b)) '(nil)) (equal (unify '(a + a) '(b + b)) nil) (equal (unify '(x + x) '(a + b)) nil)) (apply-one-sub '(X) '(X . A)) (apply-one-sub '(X) '(X A B)) (apply-one-sub '(X X) '(X . A)) (apply-one-sub '(Y (Y (X))) '(X . A)) (apply-subs '(X) '((X . A)))
1,069
Common Lisp
.lisp
54
16.092593
41
0.412463
shepherdjerred-homework/unify-function
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
72be7d3293e6a12e9566d3407f929c4669ae1078c783952e1a125588df77d148
35,539
[ -1 ]
35,540
unify.lisp
shepherdjerred-homework_unify-function/src/unify.lisp
; unify ; Jerred Shepherd ; Takes a term and applies a substitution to it ; sub is the form of (X . B) where X is the target and B is the replacement value (defun apply-one-sub (term sub) (let ( (sub-key (car sub)) (sub-value (cdr sub))) (if (eq term sub-key) sub-value (if (atom term) term (cons (apply-one-sub (car term) sub) (apply-one-sub (cdr term) sub)))))) ; Apply subs to a term ; subs follows this form ((X . B)) (defun apply-subs (term subs) (if (atom subs) (apply-one-sub term (car subs)) (apply-subs (apply-one-sub term (car subs)) (cdr subs)))) (defun occurs (term sigma) (if (eq (caar sigma) term) T (if (null (cdr sigma)) nil (occurs term (cdr sigma))))) (defun do-unify (t1 t2 sigma) (if (eq t1 t2) sigma (if (or (atom t1) (atom t2)) (if (isvar t1) (if (equal sigma '(nil)) (cons (cons t1 t2) nil) (if (occurs t1 sigma) nil (let ( (new-rule (cons (cons t1 t2) nil))) (append new-rule (apply-subs sigma new-rule))))) (if (isvar t2) (do-unify t2 t1 sigma) nil)) (let* ( (new-sigma (do-unify (car t1) (car t2) sigma)) (new-t1 (apply-subs t1 new-sigma)) (new-t2 (apply-subs t2 new-sigma))) (if (null new-sigma) nil (do-unify (cdr new-t1) (cdr new-t2) new-sigma)))))) (defun unify (t1 t2) (do-unify t1 t2 '(nil)))
1,642
Common Lisp
.lisp
71
16.253521
82
0.511821
shepherdjerred-homework/unify-function
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
e71cd63e5d8b36eff023f512375e2cd6cdf640d90fd96819aae89c06b601e363
35,540
[ -1 ]
35,558
tour.lisp
ggrabuskie_giraffe/tour.lisp
(defun getMoves (x y) (list (cons (+ x 1) (+ y 0)) ;1 right (cons (- x 1) (+ y 0)) ;1 left (cons (+ x 0) (+ y 1)) ;1 up (cons (+ x 0) (- y 1)) ;1 down (cons (+ x 2) (+ y 1)) ;2 right 1 up (cons (+ x 2) (- y 1)) ;2 right 1 down (cons (+ x 1) (+ y 2)) ;1 right 2 up (cons (+ x 1) (- y 2)) ;1 right 2 down (cons (- x 2) (+ y 1)) ;2 left 1 up (cons (- x 2) (- y 1)) ;2 left 1 down (cons (- x 1) (+ y 2)) ;1 left 2 up (cons (- x 1) (- y 2)) ;1 left 2 down ) ;close list ) ;close func
567
Common Lisp
.lisp
16
28.9375
41
0.449704
ggrabuskie/giraffe
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
db44c6ca4f7db2caf78b2dcee1ad153b5b515582199408c1a044e5fb46de1a6c
35,558
[ -1 ]
35,575
model.lisp
borodust_bamboozy/src/model.lisp
(cl:in-package :bamboozy) (declaim (special *model-height*)) (defun parse-color (string &optional (opacity 1.0)) (unless (or (null string) (equalp string "none")) (let* ((color-string (subseq string 1)) (hex-color (parse-number:parse-number color-string :radix 16))) (flet ((read-color (num) (float (/ (ldb (byte 8 (* num 8)) hex-color) 255) 0f0))) (alexandria:switch ((length color-string)) (8 (gamekit:vec4 (read-color 3) (read-color 2) (read-color 1) (read-color 0))) (6 (gamekit:vec4 (read-color 2) (read-color 1) (read-color 0) opacity)) (2 (gamekit:vec4 (read-color 0) (read-color 0) (read-color 0) opacity)) (t (error "Unrecognized color encoding"))))))) (defun parse-size (number-string) (let ((number-string (if (alexandria:ends-with-subseq "px" number-string :test #'equalp) (subseq number-string 0 (- (length number-string) 2)) number-string))) (parse-number:parse-number number-string))) ;;; ;;; FEATURES ;;; (defclass model-feature () ((id :initarg :id :initform (error ":type missing") :reader id-of) (type :initarg :type :initform (error ":type missing") :reader feature-type-of) (stroke-paint :initarg :stroke-paint :initform nil :reader stroke-paint-of) (stroke-width :initarg :stroke-width :initform nil :reader stroke-width-of) (fill-paint :initarg :fill-paint :initform nil :reader fill-paint-of))) ;;; ;;; ;;; (defclass line-feature (model-feature) ((origin :initarg :origin :reader origin-of) (end :initarg :end :reader end-of))) ;;; ;;; RECTANGLE ;;; (defclass rect-feature (model-feature) ((origin :initarg :origin :reader origin-of) (width :initarg :width :reader width-of) (height :initarg :height :reader height-of))) ;;; ;;; ELLIPSE ;;; (defclass ellipse-feature (model-feature) ((origin :initarg :origin :reader origin-of) (x-radius :initarg :x-radius :reader x-radius-of) (y-radius :initarg :y-radius :reader y-radius-of) (points :initarg :points :reader points-of))) ;;; ;;; CIRCLE ;;; (defclass circle-feature (model-feature) ((origin :initarg :origin :reader origin-of) (radius :initarg :radius :reader radius-of) (points :initarg :points :reader points-of))) ;;; ;;; PATH ;;; (defclass path-feature (model-feature) ((points :initarg :points :reader points-of))) ;;; ;;; MODEL ;;; (defclass model () ((feature-table :initform (make-hash-table :test #'equal)))) (defmethod initialize-instance :after ((this model) &key features) (with-slots (feature-table) this (loop for feature in features do (alexandria:if-let ((id (id-of feature))) (setf (gethash id feature-table) feature) (push feature (gethash nil feature-table)))))) (defun model-features (model) (with-slots (feature-table stray-feature-list) model (loop for feature being the hash-value of feature-table nconc (alexandria:ensure-list feature)))) (defun find-model-feature-by-id (model id) (with-slots (feature-table) model (gethash id feature-table))) (defun invert-model-y (number &optional (height 0)) (- *model-height* number height)) (defun extract-points (object) (loop for (x y) across (getf object :point-data) collect (gamekit:vec2 x (invert-model-y y)))) (defun parse-feature-type (style) (let ((stroke-dasharray (getf style :stroke-dasharray))) (if (or (null stroke-dasharray) (equalp "" stroke-dasharray) (equalp "null" stroke-dasharray) (equalp "none" stroke-dasharray)) :obstacle (let* ((pattern (split-sequence:split-sequence #\, stroke-dasharray))) (if pattern (if (null (third pattern)) :background :controller) :obstacle))))) (defgeneric make-model-feature (name id feature-type object &key &allow-other-keys) (:method (name id feature-type object &key) (error "Unrecognized model ~A: ~A" feature-type name))) (defmethod make-model-feature ((name (eql :path)) id type object &key fill stroke stroke-width (fill-opacity "1.0") (stroke-opacity "1.0")) (make-instance 'path-feature :id id :type type :fill-paint (parse-color fill (parse-number:parse-number fill-opacity)) :stroke-paint (parse-color stroke (parse-number:parse-number stroke-opacity)) :stroke-width (and stroke-width (parse-size stroke-width)) :points (extract-points object))) (defmethod make-model-feature ((name (eql :rect)) id type object &key fill stroke stroke-width (fill-opacity "1.0") (stroke-opacity "1.0")) (destructuring-bind (&key x y width height &allow-other-keys) object (let ((height (parse-size height))) (make-instance 'rect-feature :id id :type type :fill-paint (parse-color fill (parse-number:parse-number fill-opacity)) :stroke-paint (parse-color stroke (parse-number:parse-number stroke-opacity)) :stroke-width (and stroke-width (parse-size stroke-width)) :origin (gamekit:vec2 (parse-number:parse-number x) (invert-model-y (parse-number:parse-number y) height)) :width (parse-size width) :height height)))) (defmethod make-model-feature ((name (eql :line)) id type object &key stroke stroke-width stroke-opacity) (destructuring-bind (&key x1 y1 x2 y2 &allow-other-keys) object (make-instance 'line-feature :id id :type type :stroke-paint (parse-color stroke (parse-number:parse-number stroke-opacity)) :stroke-width (and stroke-width (parse-size stroke-width)) :origin (gamekit:vec2 (parse-number:parse-number x1) (invert-model-y (parse-number:parse-number y1))) :end (gamekit:vec2 (parse-number:parse-number x2) (invert-model-y (parse-number:parse-number y2)))))) (defmethod make-model-feature ((name (eql :ellipse)) id type object &key fill stroke stroke-width fill-opacity stroke-opacity) (destructuring-bind (&key cx cy rx ry &allow-other-keys) object (make-instance 'ellipse-feature :id id :type type :fill-paint (parse-color fill (parse-number:parse-number fill-opacity)) :stroke-paint (parse-color stroke (parse-number:parse-number stroke-opacity)) :stroke-width (and stroke-width (parse-size stroke-width)) :origin (gamekit:vec2 (parse-number:parse-number cx) (invert-model-y (parse-number:parse-number cy))) :points (extract-points object) :x-radius (parse-size rx) :y-radius (parse-size ry)))) (defmethod make-model-feature ((name (eql :circle)) id type object &key fill stroke stroke-width fill-opacity stroke-opacity) (destructuring-bind (&key cx cy r &allow-other-keys) object (make-instance 'circle-feature :id id :type type :fill-paint (parse-color fill (parse-number:parse-number fill-opacity)) :stroke-paint (parse-color stroke (parse-number:parse-number stroke-opacity)) :stroke-width (and stroke-width (parse-size stroke-width)) :origin (gamekit:vec2 (parse-number:parse-number cx) (invert-model-y (parse-number:parse-number cy))) :points (extract-points object) :radius (parse-size r)))) (defun %make-model-feature (object) (let* ((style (extract-style object)) (feature-type (parse-feature-type style)) (name (alexandria:switch ((getf object :type) :test #'equal) ("path" :path) ("line" :line) ("rect" :rect) ("ellipse" :ellipse) ("circle" :circle)))) (apply #'make-model-feature name (getf object :id) feature-type object style))) (defun extract-style (object) (alexandria:when-let ((style (getf object :style))) (loop for attrib in (split-sequence:split-sequence #\; style) for (name value) = (split-sequence:split-sequence #\: attrib) append (list (alexandria:make-keyword (uiop:standard-case-symbol-name name)) value)))) (defun make-features (model-descriptor &key height &allow-other-keys) (let ((*model-height* (parse-number:parse-number height))) (loop for object in model-descriptor collect (%make-model-feature object)))) (defun parse-model (svg-string) (multiple-value-bind (elements svg-attribs) (svgp:parse-svg-string svg-string) (make-instance 'model :features (apply #'make-features elements svg-attribs))))
9,469
Common Lisp
.lisp
184
39.98913
111
0.596968
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
9d3c9215d8220325c821dd30bab6f0597e7e5067c8be9015ad5fb4b36bb9da9d
35,575
[ -1 ]
35,576
camera.lisp
borodust_bamboozy/src/camera.lisp
(cl:in-package :bamboozy) (defparameter *camera-speed* 8) (defclass camera () ((current-position :initform (gamekit:vec2 0 0)) (timestamp :initform 0d0))) (defun camera-position (camera player-pos) (with-slots (current-position timestamp) camera (let* ((cursor-offset (gamekit:div (gamekit:subt *viewport-half* (fistmage:cursor-position)) 2)) (current-seconds (bodge-util:real-time-seconds)) (time-delta (- current-seconds timestamp)) (target-pos (gamekit:add cursor-offset (gamekit:mult (scale player-pos) -1) *viewport-half*)) (target-vec (gamekit:subt target-pos current-position)) (target-distance (ge.ng:vector-length target-vec))) (when (> target-distance 0d0) (let ((target-offset (gamekit:mult target-vec (/ (min (* time-delta *camera-speed* target-distance) target-distance) target-distance)))) (incf (gamekit:x current-position) (gamekit:x target-offset)) (incf (gamekit:y current-position) (gamekit:y target-offset)) (setf timestamp current-seconds))) current-position)))
1,245
Common Lisp
.lisp
22
43.681818
104
0.604766
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
0be6b5d7f210556afcf0991f590cf5eb94373cb0dcd8eaa9f3c7b1cdfa6c28da
35,576
[ -1 ]
35,577
utils.lisp
borodust_bamboozy/src/utils.lisp
(cl:in-package :bamboozy) (declaim (special *this-shape* *that-shape*)) (defparameter *unit-scale* 100) (defgeneric scale (value)) (defgeneric unscale (value)) (defmethod scale ((null null)) null) (defmethod unscale ((null null)) null) (defmethod scale ((number number)) (* *unit-scale* number)) (defmethod unscale ((number number)) (/ number *unit-scale*)) (defmethod scale ((vec2 gamekit:vec2)) (gamekit:vec2 (scale (gamekit:x vec2)) (scale (gamekit:y vec2)))) (defmethod unscale ((vec2 gamekit:vec2)) (gamekit:vec2 (unscale (gamekit:x vec2)) (unscale (gamekit:y vec2)))) (defgeneric render (object)) (defgeneric pre-collide (this-object that-object) (:method (this that) (declare (ignore this that)) (setf (ge.phy:collision-friction) 1.0) t)) (defgeneric collide (this-object that-object) (:method (this that) (declare (ignore this that)))) (defun shape-position (shape) (ge.phy:body-position (ge.phy:shape-body shape))) (defun shape-angle (shape) (let ((rotation (ge.phy:body-rotation (ge.phy:shape-body shape)))) (atan (gamekit:y rotation) (gamekit:x rotation)))) (defun destroy-shape (shape) (let ((body (ge.phy:shape-body shape))) (ge.ng:dispose shape) (ge.ng:dispose body)))
1,311
Common Lisp
.lisp
38
30.131579
68
0.681124
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
ee84de3918dd98097e71825e8f1bdef163a4c3e997b9069c9c5fac14f30704c5
35,577
[ -1 ]
35,578
visual.lisp
borodust_bamboozy/src/visual.lisp
(cl:in-package :bamboozy) (defgeneric make-visual-from-feature (model-feature &key &allow-other-keys)) (defclass visual () ((fill-paint :initform nil :initarg :fill-paint :reader fill-paint-of) (stroke-paint :initform nil :initarg :stroke-paint :reader stroke-paint-of) (stroke-width :initform nil :initarg :stroke-width :reader stroke-width-of))) ;;; ;;; LINE ;;; (defclass line-visual (visual) ((origin :initarg :origin :reader origin-of) (end :initarg :end :reader end-of))) (defun make-line-visual (origin end &rest opts &key &allow-other-keys) (apply #'make-instance 'line-visual :origin origin :end end opts)) (defmethod render ((this line-visual)) (gamekit:draw-line (scale (origin-of this)) (scale (end-of this)) (or (stroke-paint-of this) (fill-paint-of this)) :thickness (scale (stroke-width-of this)))) (defmethod make-visual-from-feature ((feature line-feature) &key) (make-line-visual (origin-of feature) (end-of feature) :stroke-paint (stroke-paint-of feature) :stroke-width (stroke-width-of feature))) ;;; ;;; ELLIPSE ;;; (defclass ellipse-visual (visual) ((origin :initarg :origin :reader origin-of) (x-radius :initarg :x-radius :reader x-radius-of) (y-radius :initarg :y-radius :reader y-radius-of))) (defun make-ellipse-visual (origin x-radius y-radius &rest opts &key &allow-other-keys) (apply #'make-instance 'ellipse-visual :x-radius x-radius :y-radius y-radius :origin origin opts)) (defmethod render ((this ellipse-visual)) (gamekit:draw-ellipse (scale (origin-of this)) (scale (x-radius-of this)) (scale (y-radius-of this)) :stroke-paint (stroke-paint-of this) :fill-paint (fill-paint-of this) :thickness (scale (stroke-width-of this)))) (defmethod make-visual-from-feature ((feature ellipse-feature) &key) (make-ellipse-visual (origin-of feature) (x-radius-of feature) (y-radius-of feature) :stroke-paint (stroke-paint-of feature) :stroke-width (stroke-width-of feature) :fill-paint (fill-paint-of feature))) ;;; ;;; CIRCLE ;;; (defclass circle-visual (visual) ((origin :initarg :origin :reader origin-of) (radius :initarg :radius :reader radius-of))) (defun make-circle-visual (origin radius &rest opts &key &allow-other-keys) (apply #'make-instance 'circle-visual :radius radius :origin origin opts)) (defmethod (setf origin-of) ((value gamekit:vec2) (visual circle-visual)) (let ((origin (origin-of visual))) (setf (gamekit:x origin) (gamekit:x value) (gamekit:y origin) (gamekit:y value)) value)) (defmethod render ((this circle-visual)) (gamekit:draw-circle (scale (origin-of this)) (scale (radius-of this)) :stroke-paint (stroke-paint-of this) :fill-paint (fill-paint-of this) :thickness (scale (stroke-width-of this)))) (defmethod make-visual-from-feature ((feature circle-feature) &key) (make-circle-visual (origin-of feature) (radius-of feature) :stroke-paint (stroke-paint-of feature) :stroke-width (stroke-width-of feature) :fill-paint (fill-paint-of feature))) ;;; ;;; PATH ;;; (defclass path-visual (visual) ((points :initarg :points :reader points-of))) (defun make-path-visual (points &rest opts &key &allow-other-keys) (apply #'make-instance 'path-visual :points points opts)) (defmethod render ((this path-visual)) (if (fill-paint-of this) (gamekit:draw-polygon (mapcar #'scale (points-of this)) :fill-paint (fill-paint-of this) :stroke-paint (stroke-paint-of this) :thickness (scale (stroke-width-of this))) (gamekit:draw-polyline (mapcar #'scale (points-of this)) (stroke-paint-of this) :thickness (scale (stroke-width-of this))))) (defmethod make-visual-from-feature ((feature path-feature) &key) (make-path-visual (points-of feature) :fill-paint (fill-paint-of feature) :stroke-paint (stroke-paint-of feature) :stroke-width (stroke-width-of feature))) ;;; ;;; RECTANGLE ;;; (defclass rectangle-visual (visual) ((origin :initarg :origin :reader origin-of) (width :initarg :width :reader width-of) (height :initarg :height :reader height-of))) (defun make-rectangle-visual (origin width height &rest opts &key &allow-other-keys) (apply #'make-instance 'rectangle-visual :origin origin :width width :height height opts)) (defmethod render ((this rectangle-visual)) (gamekit:draw-rect (scale (origin-of this)) (scale (width-of this)) (scale (height-of this)) :stroke-paint (stroke-paint-of this) :fill-paint (fill-paint-of this) :thickness (scale (stroke-width-of this)))) (defmethod make-visual-from-feature ((feature rect-feature) &key) (make-rectangle-visual (origin-of feature) (width-of feature) (height-of feature) :stroke-paint (stroke-paint-of feature) :stroke-width (stroke-width-of feature) :fill-paint (fill-paint-of feature)))
5,820
Common Lisp
.lisp
120
37.175
87
0.594695
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
9d9ee25f3b631aaddafe5accf55238dbd0eef27dfb680961ce142896f78490e9
35,578
[ -1 ]
35,579
game.lisp
borodust_bamboozy/src/game.lisp
(cl:in-package :bamboozy) (defparameter *viewport-width* 1024) (defparameter *viewport-height* 768) (defparameter *viewport-half* (gamekit:vec2 (/ 1024 2) (/ 768 2))) (defvar *game* nil) (defclass game () ((universe))) (defun universe () (slot-value *game* 'universe)) (defmethod initialize-instance :after ((this game) &key) (with-slots (universe) this (flet ((%on-pre-solve (this-shape that-shape) (let ((*this-shape* this-shape) (*that-shape* that-shape)) (pre-collide (ge.phy:shape-substance this-shape) (ge.phy:shape-substance that-shape)))) (%on-post-solve (this-shape that-shape) (let ((*this-shape* this-shape) (*that-shape* that-shape)) (collide (ge.phy:shape-substance this-shape) (ge.phy:shape-substance that-shape))))) (setf universe (ge.phy:make-universe :2d :on-pre-solve #'%on-pre-solve :on-post-solve #'%on-post-solve) (ge.phy:gravity universe) (gamekit:vec2 0 -9.81))))) (defun destroy-game (game) (declare (ignore game)))
1,186
Common Lisp
.lisp
26
35.153846
79
0.579268
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
60d39c04b0d27624947991394a15fcca02a39b8d912502e05a1f70b4fff143cb
35,579
[ -1 ]
35,580
bamboozy.lisp
borodust_bamboozy/src/bamboozy.lisp
(cl:in-package :bamboozy) (fistmage:defgame (bamboozy start-state) (:viewport-title "BAMBOOZY") (:viewport-width *viewport-width*) (:viewport-height *viewport-height*)) (defmethod initialize-instance ((this bamboozy) &rest args &key &allow-other-keys) (destructuring-bind (&rest args &key depends-on &allow-other-keys) args (apply #'call-next-method this :depends-on (append (list 'ge.phy:physics-system) depends-on) args))) (defmethod fistmage:initialize-game ((this bamboozy)) (setf *game* (make-instance 'game))) (defmethod fistmage:destroy-game ((this bamboozy)) (destroy-game *game*) (setf *game* nil)) (defun play () (fistmage:start 'bamboozy :resizable t))
764
Common Lisp
.lisp
17
38.058824
97
0.676754
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6847153312bb1e7d289e790d8a01615e5500aa065e4381435eb9d2dabba77db4
35,580
[ -1 ]
35,581
level.lisp
borodust_bamboozy/src/objects/level.lisp
(cl:in-package :bamboozy) ;;; ;;; CONTROLLERS ;;; (defclass controller () ((id :initarg :id :initform (error ":id missing") :reader id-of) (shape :initarg :type :reader shape-of))) (defmethod initialize-instance :after ((this controller) &key shape-constructor) (with-slots (shape) this (setf shape (funcall shape-constructor this)))) (defclass line-controller (controller) ((origin :initarg :origin) (end :initarg :end))) (defun make-line-controller (id origin end) (flet ((%make-shape (controller) (ge.phy:make-segment-shape (universe) origin end :substance controller))) (make-instance 'line-controller :origin origin :end end :id id :shape-constructor #'%make-shape))) ;;; ;;; BODIES ;;; (defgeneric make-body-from-feature (feature &key &allow-other-keys)) (defclass level-body () ((shape :initform nil))) (defmethod initialize-instance :after ((this level-body) &key shape-constructor) (with-slots (shape) this (setf shape (funcall shape-constructor this)))) (defun destroy-body (body) (with-slots (shape) body (ge.ng:dispose shape))) (defclass line-body (level-body) ()) (defmethod make-body-from-feature ((feature line-feature) &key &allow-other-keys) (flet ((%shape-constructor (body) (ge.phy:make-segment-shape (universe) (origin-of feature) (end-of feature) :substance body))) (make-instance 'line-body :shape-constructor #'%shape-constructor))) (defclass path-body (level-body) ()) (defmethod make-body-from-feature ((feature path-feature) &key &allow-other-keys) (flet ((%shape-constructor (body) (ge.phy:make-polyline-shape (universe) (points-of feature) :substance body))) (make-instance 'path-body :shape-constructor #'%shape-constructor))) (defclass ellipse-body (level-body) ()) (defmethod make-body-from-feature ((feature ellipse-feature) &key &allow-other-keys) (error "Unimplemented")) (defclass circle-body (level-body) ()) (defmethod make-body-from-feature ((feature circle-feature) &key &allow-other-keys) (flet ((%shape-constructor (body) (ge.phy:make-circle-shape (universe) (radius-of feature) :substance body))) (make-instance 'circle-body :shape-constructor #'%shape-constructor))) (defclass rectangle-body (level-body) ()) (defmethod make-body-from-feature ((feature rect-feature) &key &allow-other-keys) (flet ((%shape-constructor (body) (ge.phy:make-box-shape (universe) (width-of feature) (height-of feature) :offset (origin-of feature) :substance body))) (make-instance 'rectangle-body :shape-constructor #'%shape-constructor ))) ;;; ;;; LEVEL ;;; (defclass level () ((visuals :initform nil :initarg :visuals) (bodies :initform nil :initarg :bodies) (spawn-point :initarg :spawn :accessor spawn-point-of))) (defmethod render ((this level)) (with-slots (visuals) this (loop for visual in visuals do (render visual)))) (defun make-level (level-model) (let (visuals bodies spawn) (loop for feature in (model-features level-model) for type = (feature-type-of feature) when (equalp (id-of feature) "slime-spawn") do (setf spawn (origin-of feature)) when (or (eq :obstacle type) (eq :background type)) do (push (make-visual-from-feature feature) visuals) when (or (eq :obstacle type) (eq :controller type)) do (push (make-body-from-feature feature) bodies)) (make-instance 'level :visuals visuals :bodies bodies :spawn (or spawn (gamekit:vec2 5 5))))) (defun destroy-level (level) (with-slots (bodies) level (loop for body in bodies do (destroy-body body))))
4,179
Common Lisp
.lisp
95
34.642105
84
0.612114
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
e1b50a6aed11021d4661e263ab43e7a1db918c972d257c1594ee54f5f5b79a3f
35,581
[ -1 ]
35,582
slime.lisp
borodust_bamboozy/src/objects/slime.lisp
(cl:in-package :bamboozy) (defparameter *slime-skin-subdivision* 20) (defparameter *slime-core-stiffness* 1500) (defparameter *slime-core-damping* 20) (defparameter *slime-grounded-p* nil) (defparameter *slime-model* (parse-model (alexandria:read-file-into-string (asdf:system-relative-pathname :bamboozy "rsc/model/bamboozy.svg")))) ;;; ;;; CORE ;;; (defclass slime-core () ((body :initarg :body :reader slime-core-body) (shape :initarg :shape) (slime :initarg :slime))) (defun make-slime-core (position slime radius) (let* ((body (ge.phy:make-rigid-body (universe))) (shape (ge.phy:make-circle-shape (universe) radius :body body))) (setf (ge.phy:body-position body) position) (make-instance 'slime-core :body body :shape shape :slime slime))) (defun slime-core-position (core) (with-slots (body shape) core (ge.phy:body-position body))) (defun destroy-slime-core (core) (with-slots (body shape) core (ge.ng:dispose shape) (ge.ng:dispose body))) (defmethod collide ((this slime-core) (that level-body)) (with-slots (slime) this (register-colliding-slime-shape slime *this-shape* *that-shape*) (setf *slime-grounded-p* t))) (defmethod collide ((that level-body) (this slime-core)) (collide this that)) ;;; ;;; SKIN ;;; (defclass slime-body () ((shapes :initarg :shapes :reader slime-body-shapes) (constraints :initarg :constraints) (fill :initarg :fill) (stroke :initarg :stroke) (thickness :initarg :thickness))) (defun make-slime-body (core origin radius fill stroke thickness) (let (shapes constraints (core-offset (gamekit:subt origin (slime-core-position core)))) (labels ((%make-shape (point) (let* ((body (ge.phy:make-rigid-body (universe))) (shape (ge.phy:make-circle-shape (universe) (/ thickness 2) :body body :substance core))) (setf (ge.phy:body-position body) (gamekit:add origin point core-offset)) (push (ge.phy:make-damped-string-constraint (universe) (slime-core-body core) body radius *slime-core-stiffness* *slime-core-damping*) constraints) (push (ge.phy:make-slide-constraint (universe) (slime-core-body core) body (/ radius 10) radius) constraints) shape)) (%link-segment (prev-shape next-shape) (let ((rest-length (ge.ng:vector-length (gamekit:subt (shape-position next-shape) (shape-position prev-shape))))) (push (ge.phy:make-slide-constraint (universe) (ge.phy:shape-body prev-shape) (ge.phy:shape-body next-shape) (/ rest-length 10) rest-length) constraints))) (%next-point (num) (let ((angle (* (/ (* 2 pi) *slime-skin-subdivision*) num))) (gamekit:vec2 (* (cos angle) radius) (* (sin angle) radius))))) (loop with prev-point = (%next-point 0) with first-shape = (%make-shape prev-point) with prev-shape = first-shape for idx from 1 below *slime-skin-subdivision* for next-point = (%next-point idx) for next-shape = (%make-shape next-point) do (%link-segment prev-shape next-shape) (push prev-shape shapes) (setf prev-point next-point prev-shape next-shape) finally (%link-segment prev-shape first-shape) (push prev-shape shapes))) (make-instance 'slime-body :shapes shapes :constraints constraints :fill fill :stroke stroke :thickness thickness))) (defun destroy-slime-body (skin) (with-slots (shapes constraints) skin (loop for shape in shapes do (destroy-shape shape)) (loop for constraint in constraints do (ge.ng:dispose constraint)))) (defun calc-control-point (prev origin end &optional (scale 1.0)) (let* ((base-angle (acos (ge.ng:dot (ge.ng:normalize (ge.ng:subt prev origin)) (ge.ng:normalize (ge.ng:subt end origin))))) (tangent-angle (/ (- pi base-angle) 2)) (vec (ge.ng:mult (ge.ng:subt end origin) scale))) (ge.ng:add origin (ge.ng:mult (ge.ng:euler-angle->mat2 (- tangent-angle)) vec)))) (defmethod render ((this slime-body)) (with-slots (shapes fill stroke thickness) this (let ((first-shape (first shapes))) (ge.vg:path (ge.vg:move-to (scale (shape-position first-shape))) (loop with prev-shape = first-shape for next-shape in (rest shapes) for origin = (scale (shape-position prev-shape)) for end = (scale (shape-position next-shape)) do (ge.vg:bezier-to origin end end) (setf prev-shape next-shape) finally (ge.vg:bezier-to (scale (shape-position prev-shape)) (scale (shape-position first-shape)) (scale (shape-position first-shape)))) (setf (ge.vg:stroke-paint) stroke (ge.vg:fill-paint) fill (ge.vg:stroke-width) (scale thickness)) (ge.vg:stroke-path) (ge.vg:fill-path))))) ;;; ;;; SLIME ;;; (defclass slime () ((core :initform nil) (skin :initform nil) (grounded-p :initform nil) (colliding-shapes :initform nil) (bounding-constraints :initform nil))) (defun slime-position (slime) (with-slots (core) slime (slime-core-position core))) (defmethod initialize-instance :after ((this slime) &key position) (with-slots (core skin) this (let ((slime-core (find-model-feature-by-id *slime-model* "slime-core")) (slime-body (find-model-feature-by-id *slime-model* "slime-body"))) (setf core (make-slime-core (gamekit:add (origin-of slime-core) position) this (radius-of slime-core)) skin (make-slime-body core (gamekit:add (origin-of slime-body) position) (radius-of slime-body) (fill-paint-of slime-body) (stroke-paint-of slime-body) (stroke-width-of slime-body)))))) (defun update-slime-grounded-status (slime grounded-p) (with-slots ((this-grounded-p grounded-p)) slime (setf this-grounded-p grounded-p))) (defun slime-grounded-p (slime) (with-slots (grounded-p) slime grounded-p)) (defun push-slime (slime force) (with-slots (core skin) slime (ge.phy:apply-force (slime-core-body core) force) (loop for body-shape in (slime-body-shapes skin) do (ge.phy:apply-force (ge.phy:shape-body body-shape) force)))) (defun bind-slime (slime) (with-slots (colliding-shapes bounding-constraints) slime (loop for (this . that) in colliding-shapes do (push (ge.phy:make-pin-constraint (universe) (ge.phy:shape-body this) (ge.phy:shape-body that) :that-anchor (shape-position this)) bounding-constraints)))) (defun release-slime (slime) (with-slots (bounding-constraints) slime (loop for constraint in bounding-constraints do (ge.ng:dispose constraint)) (setf bounding-constraints nil))) (defun register-colliding-slime-shape (slime this-shape that-shape) (with-slots (colliding-shapes) slime (push (cons this-shape that-shape) colliding-shapes))) (defun reset-slime-simulation (slime) (with-slots (colliding-shapes) slime (setf colliding-shapes nil))) (defmethod render ((this slime)) (with-slots (skin) this (gamekit:with-pushed-canvas () (render skin)))) (defun spawn-slime (position) (make-instance 'slime :position position)) (defun destroy-slime (slime) (with-slots (skin core) slime (destroy-slime-core core) (destroy-slime-body skin))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9,347
Common Lisp
.lisp
198
32.540404
100
0.529955
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
219627244b96053017d38cd77c098da4655e069ef9ce09daf3c289c2a3a9dba1
35,582
[ -1 ]
35,583
start.lisp
borodust_bamboozy/src/state/start.lisp
(cl:in-package :bamboozy) (defparameter *test-level* (parse-model (alexandria:read-file-into-string (asdf:system-relative-pathname :bamboozy (format nil "rsc/level/level0.svg"))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass start-state () ((camera :initform (make-instance 'camera)) (slime :initform nil) (level :initform nil))) (defmethod fistmage:initialize-state ((this start-state) &key) (with-slots (slime level) this (setf level (make-level *test-level*) slime (spawn-slime (spawn-point-of level))))) (defmethod fistmage:discard-state ((this start-state)) (with-slots (slime level) this (destroy-slime slime) (destroy-level level))) (defmethod fistmage:button-pressed ((this start-state) (button (eql :enter))) (fistmage:transition-to 'start-state)) (defmethod fistmage:button-pressed ((this start-state) (button (eql :space)))) (defmethod fistmage:button-released ((this start-state) (button (eql :space))) (with-slots (slime) this (when (slime-grounded-p slime) (let ((direction (gamekit:normalize (gamekit:subt (fistmage:cursor-position) *viewport-half*)))) (push-slime slime (ge.ng:mult direction 5000)))))) (defmethod fistmage:button-pressed ((this start-state) (button (eql :left-control))) (with-slots (slime) this (when (slime-grounded-p slime) (bind-slime slime)))) (defmethod fistmage:button-released ((this start-state) (button (eql :left-control))) (with-slots (slime) this (release-slime slime))) (defmethod fistmage:act ((this start-state)) (with-slots (slime) this (reset-slime-simulation slime) (let ((*slime-grounded-p* nil)) (loop repeat 20 do (ge.phy:observe-universe (universe) 0.0007)) (update-slime-grounded-status slime *slime-grounded-p*)))) (defmethod fistmage:draw ((this start-state)) (with-slots (slime camera level) this (let ((camera-pos (camera-position camera (slime-position slime)))) (gamekit:translate-canvas (gamekit:x camera-pos) (gamekit:y camera-pos))) (render level) (render slime)))
2,253
Common Lisp
.lisp
48
39.875
86
0.649699
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
c2d5c2cd409f4ac3dc2b4c89ae6110a85560d3226a9483449aa403a3c244f02f
35,583
[ -1 ]
35,584
bamboozy.asd
borodust_bamboozy/bamboozy.asd
(asdf:defsystem :bamboozy :description "Autumn Lisp Game Jam 2018 Entry" :license "GPLv3" :author "Pavel Korolev" :version "1.0.0" :depends-on (bodge-utilities alexandria split-sequence parse-number cl-svg-polygon cl-bodge/physics cl-bodge/physics/2d fistmage) :pathname "src/" :serial t :components ((:file "packages") (:file "utils") (:file "game") (:file "camera") (:file "model") (:file "visual") (:module objects :serial t :components ((:file "level") (:file "slime"))) (:module state :serial t :components ((:file "start"))) (:file "bamboozy")))
835
Common Lisp
.asd
23
23
85
0.477833
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
5dda675e18ea2e70b12c69b61b4e7bcec6a211c4e8d37ff2c9c5dfce42627a68
35,584
[ -1 ]
35,586
.travis.yml
borodust_bamboozy/.travis.yml
language: common-lisp sudo: false addons: apt: packages: - zip env: global: - GAMEKIT_SYSTEM_NAME: bamboozy - GAMEKIT_APPLICATION_PACKAGE: bamboozy - GAMEKIT_APPLICATION_MAIN_CLASS: bamboozy - PATH: ~/bin/:$PATH - GAMEKIT_TARGET_PACKAGE: $GAMEKIT_SYSTEM_NAME-x86-64-$TRAVIS_OS_NAME-$TRAVIS_BRANCH.zip - GAMEKIT_BUILD_DIR: /tmp/$GAMEKIT_SYSTEM_NAME - secure: "x7udstghY4ySz7nbTzk6/7vApF99/iFpSd6cYSaRqN9bd9So08buPzTpESMZOXiqZ4xt7v2XgQrtHWWSFFcKZhYLDEYXSXSCzH0DCwub0JW/uI3nu4oXcXlCxB3jUXhj11WIaOg+9vO4Pz5WU5qaB78N5aUQAhCRfW2CiUT/VTRlCGh/yaNHL2YwPq4dHQrkddIjBqI4FNziKySnrHZLc1ANzIzbTJuwOKTedl3B8L1GBDURKQwzEjTWtULV7MZPHPIQH62yRJpyUVPHdmEBj7Lco+hUUjJmpBGPhoISRuURgdUvScUMJTutcr2H0Z7r5Q65aN/fL6EJZ8rW1fRH1z8bDFwZdkCVDMUdFiCIvEj+AT6I+iwbwMa+9l+c4fOz1phrHF5Jvnmchv0fbpAotacmXmMm9fv0EJDUV4NctdNzec+lKwHzYrh9BzRMcVYDQUoLnPAwy3chv1A9B/0fUzNvPXaeS3Yv8p/BAVWcJd1fjzg6DAHYkRCCXGL9OECmR2+CgHKaTFRKVwah35dGBAD7VXszDy2h9c1jMQRdcAJkO1LdGTF1A2njeTVPVn5nqh91cL0B90bw8bWV7wzs+sCWspbLuuXMmcbJw3WKvH3m7B1D8GO+WmyTsNWUAbTlt70MtrJz/+r7g4gxc+VNm/UJ3dpJ224grcOwKYCBa6M=" branches: only: - "/^v\\d+(\\.\\d+)+$/" os: - linux - osx install: - curl -L http://bodge.borodust.org/files/install.sh | sh script: - > lisp $HOME/bodge/scripts/build-experimental-gamekit-system.lisp $GAMEKIT_SYSTEM_NAME $GAMEKIT_APPLICATION_PACKAGE $GAMEKIT_APPLICATION_MAIN_CLASS $TRAVIS_BUILD_DIR $GAMEKIT_BUILD_DIR t before_deploy: - mv "$GAMEKIT_BUILD_DIR/$GAMEKIT_SYSTEM_NAME.zip" $GAMEKIT_TARGET_PACKAGE deploy: provider: releases api-key: $GITHUB_TOKEN file: $GAMEKIT_TARGET_PACKAGE skip_cleanup: true overwrite: true on: tags: true
1,673
Common Lisp
.l
40
38.675
698
0.820308
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
435723cdcb280e93d1d9e7ead8e2e870641fe0605d1716e32a73f720a4505fb6
35,586
[ -1 ]
35,587
.appveyor.yml
borodust_bamboozy/.appveyor.yml
image: - Visual Studio 2017 platform: - x64 environment: global: GAMEKIT_SYSTEM_NAME: bamboozy GAMEKIT_APPLICATION_PACKAGE: bamboozy GAMEKIT_APPLICATION_MAIN_CLASS: bamboozy GAMEKIT_ARTIFACT: $(GAMEKIT_SYSTEM_NAME)-x86-64-windows-$(APPVEYOR_REPO_TAG_NAME).zip GAMEKIT_BUILD_DIR: $(TMP)\$(GAMEKIT_SYSTEM_NAME) MSYS2_DIR: msys64 MSYSTEM: mingw64 PATH: C:\$(MSYS2_DIR)\$(MSYSTEM)\bin;C:\$(MSYS2_DIR)\usr\bin;$(PATH) skip_non_tags: true branches: only: - master - "/^v\\d+(\\.\\d+)+$/" install: - > sh -c " pacman --needed --noconfirm -S zip unzip && curl -L http://bodge.borodust.org/files/install.sh | sh " build_script: - > sh -c " $HOME/bin/lisp $HOME/bodge/scripts/build-experimental-gamekit-system.lisp %GAMEKIT_SYSTEM_NAME% %GAMEKIT_APPLICATION_PACKAGE% %GAMEKIT_APPLICATION_MAIN_CLASS% $(cygpath -u '%APPVEYOR_BUILD_FOLDER%') $(cygpath -u '%GAMEKIT_BUILD_DIR%') t " - mv %GAMEKIT_BUILD_DIR%\%GAMEKIT_SYSTEM_NAME%.zip %GAMEKIT_ARTIFACT% artifacts: - path: "%GAMEKIT_ARTIFACT%" name: release_archive deploy: provider: GitHub release: $(APPVEYOR_REPO_TAG_NAME) tag: $(APPVEYOR_REPO_TAG_NAME) description: $(APPVEYOR_REPO_COMMIT_MESSAGE) auth_token: secure: Z5XWjDOBlCrmfz3SQAjnLKtdgI5B2b/owJhRPNWYGrI+qwVNbBc4cZiroBZReWP7 artifact: release_archive force_update: true draft: false prerelease: false on: appveyor_repo_tag: true
1,467
Common Lisp
.l
51
25.019608
89
0.700994
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
73d89b297dd4ca7f07fbc6d1b8ffa60be9c030aa90a1834b2b7fad3d321d6794
35,587
[ -1 ]
35,597
level0.svg
borodust_bamboozy/rsc/level/level0.svg
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="100" height="100" viewBox="0 0 100 100" version="1.1" id="root" inkscape:version="0.92.3 (2405546, 2018-03-11)" sodipodi:docname="level0.svg"> <defs id="defs"> <inkscape:path-effect effect="skeletal" id="path-effect1398" is_visible="true" pattern="M 0,5 C 0,2.24 2.24,0 5,0 7.76,0 10,2.24 10,5 10,7.76 7.76,10 5,10 2.24,10 0,7.76 0,5 Z" copytype="single_stretched" prop_scale="1" scale_y_rel="false" spacing="0" normal_offset="0" tang_offset="0" prop_units="false" vertical_pattern="false" fuse_tolerance="0" /> </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627417" inkscape:cx="3.1013789" inkscape:cy="10.056863" inkscape:document-units="px" inkscape:current-layer="root_layer" showgrid="false" units="px" inkscape:pagecheckerboard="false" inkscape:window-width="3840" inkscape:window-height="2003" inkscape:window-x="-18" inkscape:window-y="-18" inkscape:window-maximized="1" /> <metadata id="meta"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title /> </cc:Work> </rdf:RDF> </metadata> <g inkscape:label="Base Layer" inkscape:groupmode="layer" id="root_layer"> <rect style="fill:#5e605c;fill-opacity:1;stroke:#000000;stroke-width:0.04958659;stroke-miterlimit:4;stroke-dasharray:0.04958659, 0.04958659;stroke-dashoffset:0;stroke-opacity:1" id="rect1380" width="447.5087" height="190.30756" x="-243.41086" y="-15.245121" /> <path style="fill:#202120;fill-opacity:1;stroke:#000000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M -6.3716225,93.231622 C 6.6640915,124.48162 14.348048,146.09863 47.562334,145.38434 80.77662,144.67006 121.02518,113.57799 121.02518,113.57799 l 11.02701,41.04601 12.72792,34.1179 -185.085196,1.76777 z" id="path1410" inkscape:connector-curvature="0" sodipodi:nodetypes="csccccc" /> <path style="fill:none;stroke:#000000;stroke-width:0.03401782;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 151.02757,189.80256 -16.19873,-83.58765 c 0,0 28.30661,11.41393 42.70821,5.04997 14.40159,-6.36396 22.57206,-12.173547 8.08864,-24.901469 -14.48342,-12.727922 -36.09781,-5.466883 -36.09781,-5.466883" id="path4548" inkscape:connector-curvature="0" sodipodi:nodetypes="ccssc" /> <path style="fill:none;stroke:#000000;stroke-width:0.04176429;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 181.32277,90.343838 c -21.481,9.172036 -90.165965,13.165842 -99.300116,4.686041 -9.13415,-8.479805 -8.900951,-17.122698 -8.900951,-17.122698 0,0 1.891631,-3.726616 3.3125,-5.21875 1.921432,-2.017803 6.829795,-4.819211 6.829795,-4.819211 -3.71619,-2.109284 -10.759142,-6.714884 -11.922932,-12.673888 0,0 0.114998,-2.922419 4.335606,-4.739519" id="path4552" inkscape:connector-curvature="0" sodipodi:nodetypes="cscaccc" /> <path style="fill:none;stroke:#000000;stroke-width:0.04451075;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="m 149.52788,80.896528 c 0,0 -72.700442,10.561282 -65.850559,-2.361811 14.550361,-27.45093 -8.596885,-22.124261 -8.596885,-22.124261 l 19.86031,-7.291618" id="path4554" inkscape:connector-curvature="0" sodipodi:nodetypes="cscc" /> <circle style="fill:#3a9324;fill-opacity:1;stroke:#000000;stroke-width:0.30000001;stroke-miterlimit:4;stroke-dasharray:0.6, 0.3, 0.15, 0.3;stroke-dashoffset:0;stroke-opacity:1" id="slime-spawn" cx="1.8360888" cy="95.688499" r="1" /> <path style="fill:none;stroke:#000000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 94.940746,49.118838 C 105.125,46.6875 112.375,54.125 106.5625,59.5 100.75,64.875 97.125,58.4375 97.125,58.4375" id="path4585" inkscape:connector-curvature="0" sodipodi:nodetypes="csc" /> <path style="fill:none;stroke:#000000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" d="m 75.676672,50.455813 c 0,0 29.823328,-12.955813 36.323328,-6.143313 6.5,6.8125 6.4375,17.625 0.0625,24.875 -6.375,7.25 -14.125,2.75 -17.5,0.125 -3.375,-2.625 -8.718522,-13.829747 1.6875,-15.75 7.11255,-1.3125 6.9375,3.6875 6.9375,3.6875" id="path4587" inkscape:connector-curvature="0" sodipodi:nodetypes="cssssc" /> <path style="fill:none;stroke:#000000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" d="m 97.125,58.4375 c 0,0 2.25,2.125 3.9375,1.625 1.6875,-0.5 2.125,-2.8125 2.125,-2.8125" id="path4589" inkscape:connector-curvature="0" /> <path style="fill:none;stroke:#000000;stroke-width:0.05;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 151.02757,189.80256 241.5,187.25 240.5,13 26,13.5 c 0,0 7.25,90.75 21.5,91.25 14.25,0.5 134.25,-6.000002 133.82277,-14.406162" id="path4591" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccsc" /> <path style="fill:none;stroke:#000000;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:0.1,0.1;stroke-dashoffset:0;stroke-opacity:1" d="m 2.125,101.125 c 3.4375,7.1875 6.8125,10.8125 6.8125,10.8125 L 8.3125,109.5" id="path4593" inkscape:connector-curvature="0" /> <path style="fill:none;stroke:#000000;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:0.1,0.1;stroke-dashoffset:0" d="M 8.9375,111.9375 7,110.8125" id="path4597" inkscape:connector-curvature="0" /> <rect style="fill:#5264ab;fill-opacity:1;stroke:#5264f0;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:0.1, 0.10000000000000001;stroke-dashoffset:0;stroke-opacity:0.99607843" id="rect4599" width="1.25" height="1.25" x="99.9375" y="58.0625" /> <rect style="fill:#588c6b;fill-opacity:1;stroke:#5264f0;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:0.2, 0.10000000000000001, 0.05000000000000000, 0.10000000000000001;stroke-dashoffset:0;stroke-opacity:0.99607843" id="rect4616" width="0.80000001" height="0.80000001" x="100.15234" y="58.300781" /> </g> </svg>
7,663
Common Lisp
.l
156
42.467949
353
0.676392
borodust/bamboozy
0
0
0
GPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6886588f07fe5e534a6c01871c589d9b2b856d5d0e2e60b4d90cf40386ae181d
35,597
[ -1 ]
35,612
load-gendl.lisp
lisp-mirror_gendl/load-gendl.lisp
(in-package :common-lisp-user) (let ((personal-boot-file "../gdl/tools/boot/load.lisp")) (when (probe-file personal-boot-file) (load personal-boot-file))) (funcall (find-symbol (string '#:quickload) :ql) :gendl) (gendl:start-gendl!)
238
Common Lisp
.lisp
5
45.6
67
0.717391
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
1b8cfc24324e6f3a26a683b6a6583590b09e580b90f712f6a92235ba735b32f5
35,612
[ -1 ]
35,613
gendl-asdf.lisp
lisp-mirror_gendl/gendl-asdf.lisp
;;;; -*- coding: utf-8 -*- (in-package :cl-user) (defclass asdf::gdl (asdf::cl-source-file) ((type :initform "gdl"))) (defclass asdf::gendl (asdf::cl-source-file) ((type :initform "gendl"))) (defclass asdf::lisp (asdf::cl-source-file) ())
242
Common Lisp
.lisp
5
46.8
72
0.653846
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
d88f934a6918ac2f9e538479a257aefa6cf7e05059f5a7ab0512f08210d3e090
35,613
[ -1 ]
35,614
setup.lisp
lisp-mirror_gendl/setup-cffi/source/setup.lisp
;;(when (find-package :cffi) (in-package :cffi)) #-allegro (in-package :cffi) #-allegro (defun %exe-path% () #+sbcl (make-pathname :name nil :type nil :defaults sb-ext:*core-pathname*) #+ccl (make-pathname :name nil :type nil :defaults (first (ccl::command-line-arguments))) #+allegro (translate-logical-pathname "sys:") #+lispworks (make-pathname :name nil :type nil :defaults (first system:*line-arguments-list*))) #-allegro (when (find-package :cffi) (pushnew (merge-pathnames (format nil "dlls/~a/" (if (member :32-bit-host *features*) "32" "64")) (%exe-path%)) (symbol-value (read-from-string "cffi:*foreign-library-directories*"))) (define-foreign-library libeay32 (:windows "libeay32.dll")) (use-foreign-library libeay32))
784
Common Lisp
.lisp
17
41.941176
100
0.682477
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
a85839ca83008350410bb6d837e841a89b85bdb91466b5589fb818c08d027328
35,614
[ -1 ]
35,615
general-note.lisp
lisp-mirror_gendl/regression/geom-base/source/general-note.lisp
(in-package :gdl-user) (define-object general-note-sample (base-object) :objects ((x-axis :type 'line :start (make-point 0 0 0) :end (make-point 1 0 0)) (origin-text :type 'general-note :start (make-point 0 0 0) :outline-shape-type :rectangle :strings "O" :character-size 0.1)))
296
Common Lisp
.lisp
8
33.875
73
0.686411
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
865c2c67094866db040b71c704cf1e0537d331e25cc7fe19bf23ecad4614a4c5
35,615
[ -1 ]
35,616
angle-between-vectors.lisp
lisp-mirror_gendl/regression/geom-base/source/angle-between-vectors.lisp
(in-package :gdl-lift-tests) (define-object angle-between-vectors-test () :input-slots ((vector-1 (make-vector 1 0 0)) (vector-2 (make-vector 0 1 0)) (vector-3 (make-vector 0 0 1))) :computed-slots ((vector-3-r (reverse-vector (the vector-3))) (regression-test-data (list (angle-between-vectors (the vector-1) (the vector-2)) (angle-between-vectors-d (the vector-1) (the vector-2)) (angle-between-vectors (the vector-1) (the vector-2) (the vector-3) :negative? t) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3) :negative? t) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3) t) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3) :negative? t :epsilon 0.1) (angle-between-vectors (the vector-1) (the vector-2) (the vector-3-r) :negative? t) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3-r) :negative? t) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3-r) t) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3-r) :negative? t :epsilon 0.1) (angle-between-vectors (the vector-1) (the vector-2) (the vector-3-r) ) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3-r)) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3-r)) (angle-between-vectors-d (the vector-1) (the vector-2) (the vector-3-r) :epsilon 0.1) )))) (register-test-definition 'angle-between-vectors-test)
1,608
Common Lisp
.lisp
24
58.416667
108
0.64359
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
14dc078b95e6d6a623c3dd795bafe5c07cd8ceb2347f13776aae68f2f71ffa7f
35,616
[ -1 ]
35,617
box-matrix.lisp
lisp-mirror_gendl/regression/geom-base/source/box-matrix.lisp
(in-package :gdl-user) #+nil (define-object box-matrix (base-object) :input-slots ((rows 50) (columns 50)) :objects ((box-container :type 'box-container :box-length 10 :box-width 10 :box-height 1 :pass-down (rows columns)) (box-solid-container :type 'box-solid-container :box-length 10 :box-width 10 :box-height 1 :pass-down (rows columns)) (planar-surface-container :type 'planar-surface-container :box-length 10 :box-width 10 :box-height 1 :pass-down (rows columns)) )) #+nil (define-object planar-surface-container (base-object) :input-slots (box-length box-width box-height rows columns) :computed-slots ((width (* (the box-width) (the columns))) (length (* (the box-length) (the rows)))) :objects ((planes :type 'planar-surface :p00 (translate (the-child center) :left (half (the-child width)) :front (half (the-child length))) :p01 (translate (the-child p00) :right (the-child width)) :p10 (translate (the-child p01) :rear (the-child length)) :p11 (translate (the-child p10) :left (the-child width)) :length (the box-length) :width (the box-width) :height (the box-height) :sequence (:matrix :longitudinal (the rows) :lateral (the columns))))) #+nil (define-object box-container (base-object) :input-slots (box-length box-width box-height rows columns) :computed-slots ((width (* (the box-width) (the columns))) (length (* (the box-length) (the rows)))) :objects ((boxes :type 'box :length (the box-length) :width (the box-width) :height (the box-height) :sequence (:matrix :longitudinal (the rows) :lateral (the columns))))) #+nil (define-object box-solid-container (base-object) :input-slots (box-length box-width box-height rows columns) :computed-slots ((width (* (the box-width) (the columns))) (length (* (the box-length) (the rows)))) :objects ((boxes :type 'box-solid :length (the box-length) :width (the box-width) :height (the box-height) :sequence (:matrix :longitudinal (the rows) :lateral (the columns)))))
2,207
Common Lisp
.lisp
68
27.323529
61
0.656802
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
9a458d973f6c11a9d759a68aabe61cbbdf9c588724657e6fd3914ba1a9228a7a
35,617
[ -1 ]
35,618
drawing.lisp
lisp-mirror_gendl/regression/geom-base/source/drawing.lisp
(in-package :gdl-user) (define-object box-with-annotated-drawing (base-object) :objects ((drawing :type 'box-annotated-drawing :dl-objects (list (the box))) (box :type 'box :length 10 :width 20 :height 30))) (define-object box-annotated-drawing (base-drawing) :input-slots (dl-objects (character-size 15) (witness-line-gap 10) (witness-line-length 15) (witness-line-ext 5)) :objects ((tri-view :type 'base-view :projection-vector (getf *standard-views* :trimetric) :length (half (the length)) :width (half (the width)) :center (translate (the center) :rear (half (the-child length)) :left (half (the-child width))) :objects (the dl-objects) :annotation-objects (list (the main-length-dim))) (top-view :type 'base-view :view-scale (* (getf (the-child view-contents-data) :view-scale) 0.8) :projection-vector (getf *standard-views* :top) :length (half (the length)) :width (half (the width)) :center (translate (the center) :rear (half (the-child length)) :right (half (the-child width))) :objects (the dl-objects) :annotation-objects (list (the top-width-dim) (the top-length-dim))) (main-length-dim :type 'vertical-dimension :pass-down (character-size witness-line-gap witness-line-length witness-line-ext) :start-point (the tri-view (view-point (the box (vertex :rear :top :right)))) :end-point (the tri-view (view-point (the box (vertex :rear :bottom :right)))) :dim-value (3d-distance (the box (vertex :rear :top :right)) (the box (vertex :rear :bottom :right))) :text-above-leader? nil) (front-view :type 'base-view :view-scale (* (getf (the-child view-contents-data) :view-scale) 0.8) :projection-vector (getf *standard-views* :front) :length (half (the length)) :center (translate (the center) :front (half (the-child length))) :objects (the dl-objects) :annotation-objects (list (the bottom-length-dim))) (top-width-dim :type 'horizontal-dimension :pass-down (character-size witness-line-gap witness-line-length witness-line-ext) :start-point (the top-view (view-point (the box (vertex :top :front :left)))) :end-point (the top-view (view-point (the box (vertex :top :front :right)))) :text-above-leader? nil :flip-leaders? t :dim-scale (/ (the top-view view-scale))) (top-length-dim :type 'vertical-dimension :pass-down (character-size witness-line-gap witness-line-length witness-line-ext) :start-point (the top-view (view-point (the box (vertex :top :rear :right)))) :end-point (the top-view (view-point (the box (vertex :top :front :right)))) :flip-leaders? nil :dim-scale (/ (the top-view view-scale))) (bottom-length-dim :type 'horizontal-dimension :pass-down (character-size witness-line-gap witness-line-length witness-line-ext) :start-point (the front-view (view-point (the box (vertex :front :bottom :left)))) :end-point (the front-view (view-point (the box (edge-center :front :right)))) :text-above-leader? nil :dim-value (the box width) :dim-text-bias :start :flip-leaders? t :outside-leaders? t ) #+nil (bottom-length-dim :type 'horizontal-dimensions :pass-down (character-size witness-line-gap witness-line-length witness-line-ext) :start-point (the front-view (view-point (the box (vertex :front :bottom :left)))) :dim-scale (/ (the front-view view-scale)) :text-above-leader? nil :flip-leaders? t :end-point (the front-view (view-point (the box (vertex :front :bottom :right))))) ))
4,159
Common Lisp
.lisp
76
42.513158
101
0.592024
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
102fff538af03638ebc58a62b89bdaf073bc6b8c9d3f2adee2d1d0fa37f22737
35,618
[ -1 ]
35,619
package.lisp
lisp-mirror_gendl/regression/utils/source/package.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (gdl:define-package :gdl-lift-utils (:use :lift) (:export #:register-test-definition #:stress-test))
959
Common Lisp
.lisp
21
44.428571
100
0.758805
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
eadd443bedcb0018d220df56ad3a8b33aea79b14f03fcf271890f984b16df272
35,619
[ -1 ]
35,620
functions.lisp
lisp-mirror_gendl/regression/utils/source/functions.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-utils) #+nil (eval-when (compile load eval) (glisp:extend-stack 100)) (defvar *gdl-test-definitions* nil) (defun register-test-definition (symbol) (pushnew symbol *gdl-test-definitions*)) (defun get-regression-data (symbol) (multiple-value-list (the-object (make-object symbol) :regression-test-data))) (defun get-regression-data-from-object (object) (multiple-value-list (the-object object :regression-test-data))) (defun test-object (object) (ensure-same (get-seed-data (the-object object type)) (get-regression-data-from-object object) :test 'equivalent-lists)) (defun seed-test-data (symbol) (let ((*print-length* nil)) (with-open-file (out (merge-pathnames (make-pathname :name (string-downcase (format nil "~a" symbol)) :type "data") *lift-data-directory*) :direction :output :if-exists :supersede :if-does-not-exist :create) (print (get-regression-data symbol) out)))) (defun seed-all-test-data (&key (times 1)) (dolist (symbol *gdl-test-definitions*) (format t "Seeding data ~afor ~s...~%" (if (= times 1) "" (format nil "with stress-test of ~a iterations " times)) symbol) (dotimes (n times) (seed-test-data symbol) (when (> times 1) (glisp:gc-full))))) #+nil (defun seed-all-test-data () (dolist (symbol *gdl-test-definitions*) (format t "Seeding data for ~s...~%" symbol) (with-error-handling (:timeout 20) (seed-test-data symbol)))) (defun get-seed-data (symbol) (with-open-file (in (merge-pathnames (make-pathname :name (string-downcase (format nil "~a" symbol)) :type "data") *lift-data-directory*) :direction :input :if-does-not-exist nil) (when in (let (*read-eval*) (read in))))) (defun read-all-seed-data () (dolist (symbol *gdl-test-definitions*) (format t " ~s~%" symbol) (get-seed-data symbol)) t) (defun read-all-regression-data () (dolist (symbol *gdl-test-definitions*) (format t " ~s~%" symbol) (get-regression-data symbol)) t) (defun define-regression-tests () (let ((lift:*test-evaluate-when-defined?* nil)) (lift:deftestsuite gdl-lift-utils::gdl-regression-tests () () (:setup (glisp:gc-full))) (dolist (symbol (reverse *gdl-test-definitions*)) (let ((test (format nil "(lift:addtest (gdl-lift-utils::gdl-regression-tests) ~s (lift:ensure-same (gdl-lift-utils::get-seed-data '~s) (gdl-lift-utils::get-regression-data '~s) :test 'gdl-lift-utils::equivalent-lists))" symbol symbol symbol))) (eval (read-from-string test)))))) (defun add-regression-test (symbol) (let ((lift:*test-evaluate-when-defined?* nil) (test (format nil "(lift:addtest (gdl-lift-utils::gdl-regression-tests) ~s (lift:ensure-same (gdl-lift-utils::get-seed-data '~s) (gdl-lift-utils::get-regression-data '~s) :test 'gdl-lift-utils::equivalent-lists))" symbol symbol symbol))) (eval (read-from-string test)))) (defvar *regression-test-report* nil) (defparameter *passed-report-size* 64) (defvar *regression-tests-result* nil) (defvar *regression-test-result* nil) (defun run-regression-tests (&key (print-length 10)) (let ((lift:*test-print-test-case-names* t) (lift:*lift-debug-output* *standard-output*) (lift:*test-break-on-errors?* nil) (lift:*test-break-on-failures?* nil) (*print-length* print-length)) (glisp:close-old-areas) (setq *regression-test-report* (with-output-to-string (out) (lift:describe-test-result (lift:run-tests :suite 'gdl-regression-tests :report-pathname (merge-pathnames "gdl-regression-tests-result.txt" (user-homedir-pathname))) out))) (glisp:open-old-areas) (setq *regression-tests-result* lift:*test-result*) (if (< (length *regression-test-report*) *passed-report-size*) *regression-test-report* "Some test failed check variable gdl-lift-utils::*regression-test-report* for details"))) (defun run-regression-tests-pass-fail (&key (print-length 10)) (< (length (run-regression-tests :print-length print-length)) *passed-report-size*)) (defun run-regression-test (symbol &key (print-length 10)) (let ((lift:*test-print-test-case-names* t) (lift:*lift-debug-output* *standard-output*) (lift:*test-break-on-errors?* nil) (lift:*test-break-on-failures?* nil) (*chain-beziers-for-display?* t) (*print-length* print-length) (lift:*lift-report-pathname* (merge-pathnames "gdl-regression-test-result.txt" (user-homedir-pathname)))) (setq *regression-test-result* (lift:run-test :suite 'gdl-regression-tests :test-case symbol)) (with-output-to-string (out) (lift:describe-test-result *regression-test-result* out)))) (defun list-failures() (when lift:*test-result* (mapcar 'lift::test-method (lift:failures lift:*test-result*)))) (defun list-errors() (when lift:*test-result* (mapcar 'lift::test-method (lift:errors lift:*test-result*)))) (defun seed-failures() (when lift:*test-result* (mapcar #'(lambda (failure) (format t "Seeding ~a ...~%" (lift::test-method failure)) (seed-test-data (intern (symbol-name (lift::test-method failure)) :gdl-lift-tests))) (lift:failures lift:*test-result*))) nil) ;; ;; FLAG -- convert this to proper recursive comparison of nested lists ;; (defun equivalent-lists (list1 list2) (cond ((and (consp list1) (consp list2)) (let ((l1 (flatten list1)) (l2 (flatten list2))) (when (equal (length l1) (length l2)) (every #'(lambda (test) (equal test t)) (mapcar #'equivalent-atoms l1 l2))))) ((and (atom list1) (atom list2)) (equivalent-atoms list1 list2)) (t nil))) (defun equivalent-atoms (a1 a2) (cond ((and (numberp a1) (numberp a2)) (cond ((and (near-zero? a1 0.1) (near-zero? a2 0.1)) t) ((< (abs a1) 100) (or (near-to? (abs a1) (abs a2) 11.0) (format t "~&~% ~s is not equal enough to ~s to pass the test.~%~%" a1 a2))) (t (or (near-to? (abs a1) (abs a2) (* (abs a1) 0.1)) (format t "~&~% ~s is not equal enough to ~s to pass the test.~%~%" a1 a2))))) ((and (stringp a1) (stringp a2)) (string-equal a1 a2)) ((and (arrayp a1) (arrayp a2)) (equivalent-lists (coerce a1 'list) (coerce a2 'list))) ((and (symbolp a1) (symbolp a2)) (equal (intern (string-upcase (string a1)) (symbol-package a1)) (intern (string-upcase (string a2)) (symbol-package a2)))) (t nil))) (defun quick-test (symbol &key (times 100) (report-interval 10) (warmup-runs 0) (output-stream *trace-output*)) (stress-test symbol :times times :report-interval report-interval :warmup-runs warmup-runs :output-stream output-stream)) (defun stress-test (symbol &key (times 1000) (report-interval 100) (warmup-runs 100) (output-stream *trace-output*)) (dotimes (n warmup-runs) (the-object (make-object (glisp:intern symbol :gdl-lift-tests)) regression-test-data)) (multiple-value-bind (mem1-prev mem2-prev) (glisp:get-mem-info) (let ((mem1-orig mem1-prev) (mem2-orig mem2-prev)) (dotimes (n times) (when (and (not (zerop n)) (zerop (mod n report-interval))) (format output-stream "Processing iteration ~a...~%" n) (multiple-value-bind (mem1 mem2) (glisp:get-mem-info) (when (or (/= mem1 mem1-prev)(/= mem2 mem2-prev)) (format output-stream " Memory status changed from: ~a/~a to ~a/~a~%" mem1-prev mem2-prev mem1 mem2)) (setq mem1-prev mem1 mem2-prev mem2))) (the-object (make-object (intern symbol :gdl-lift-tests)) regression-test-data) (glisp:gc-scavenge) ) (glisp:gc-full) (format output-stream "Summary For test def ~a:~%~%" symbol) (multiple-value-bind (mem1 mem2) (glisp:get-mem-info) (if (or (/= mem1 mem1-orig) (/= mem2 mem2-orig)) (format output-stream " Cumulative memory change from ~a/~a to ~a/~a for a diff of ~a/~a~%" mem1-orig mem2-orig mem1 mem2 (- mem1 mem1-orig) (- mem2 mem2-orig)) (format output-stream "*** Memory status unchanged. ***~%~%")))))) (defun stress-tests (&key (symbols *gdl-test-definitions*) (times 100) (report-interval 10) (warmup-runs 10) ;;(outfile (format nil "~~/~a.out" (gwl::iso-time (get-universal-time)))) ) ;;(with-open-file (out outfile :direction :output :if-exists :supersede ;;:if-does-not-exist :create)) (let ((out *trace-output*)) (dolist (symbol symbols) (format out "Running Stresstests for ~a...~%~%" symbol) (with-error-handling (:error? t :timeout 300) (stress-test symbol :times times :report-interval report-interval :warmup-runs warmup-runs :output-stream out)))))
9,656
Common Lisp
.lisp
216
39.828704
236
0.667698
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
6505b7fdb5f1ba7cbb38ac0d634b7b209f97b23cbed1f6fbd97027a0134d3b2c
35,620
[ -1 ]
35,621
genworks.lisp
lisp-mirror_gendl/regression/utils/source/genworks.lisp
(in-package :com.genworks.lisp) (defun close-old-areas () #+allegro (setf (sys:gsgc-parameter :open-old-area-fence) -1) #-allegro (warn "Learn how to close old areas in currently running Lisp.~%")) (defun open-old-areas () #+allegro (setf (sys:gsgc-parameter :open-old-area-fence) 0) #-allegro (warn "Learn how to open old areas in currently running Lisp.~%")) (defun get-mem-info () #+allegro (excl.osi:get-mem-info) #-allegro (progn (warn "Learn how to get mem info in currently running Lisp.~%") (values 0 0))) (defun gc-scavenge () #+allegro (excl:gc) #-allegro (warn "Learn how to get mem info in currently running Lisp.~%"))
657
Common Lisp
.lisp
15
41.066667
97
0.698113
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
b0af6ff242878995e2b8cc6a487b0c42aeac27fff95985483f437d81e2a2a971
35,621
[ -1 ]
35,622
bracket.lisp
lisp-mirror_gendl/regression/assembly-output/source/bracket.lisp
(in-package :bracket) (define-object simple-bracket (base-object) :input-slots ( (thickness 2 :settable) (width 100 :settable) (length-A 10 :settable) (length-B 30 :settable) (length-C 10 :settable) (angle-AB 45 :settable) (angle-BC 90 :settable) (radius-AB 2 :settable) (radius-BC 2 :settable) (number-of-holes 3 :settable) (hole-radius 5 :settable) (hide-holes? nil :settable) ) :computed-slots ( (length-XA (- (the length-A) (* (+ (the radius-AB) (the thickness)) (tan (degrees-to-radians (* 0.5 (the angle-AB))))))) (length-XB (- (the length-B) (+ (* (+ (the radius-AB) (the thickness)) (tan (degrees-to-radians (* 0.5 (the angle-AB))))) (* (+ (the radius-BC) (the thickness)) (tan (degrees-to-radians (* 0.5 (the angle-BC)))))))) (length-XC (- (the length-C) (* (+ (the radius-BC) (the thickness)) (tan (degrees-to-radians (* 0.5 (the angle-BC))))))) ) :objects ( (part-A :type 'box-solid :width (the length-XA) :length (the width) :height (the thickness) :display-controls (list :color :blue :transparency 0.5) :center (translate (translate-along-vector (translate-along-vector (the bend-AB reference-point) (the bend-AB reference-top) (* -0.5 (the thickness))) (the bend-AB reference-right) (* 0.5 (the-child width))) :rear (* 0.5 (the width))) :orientation (alignment :top (the bend-AB reference-top) :right (the bend-AB reference-right))) (part-B :type 'box-solid-with-holes :width (the length-XB) :length (the width) :height (the thickness) :display-controls (list :color :blue :transparency 0.5) :center (translate (the center) :bottom (* 0.5 (the thickness))) :hole-brep-list (mapcar #'(lambda (x) (the-object x cylinder)) (list-elements (the hole)))) (part-C :type 'box-solid :width (the length-XC) :length (the width) :height (the thickness) :display-controls (list :color :blue :transparency 0.5) :center (translate (translate-along-vector (translate-along-vector (the bend-BC reference-point) (the bend-BC reference-top) (* -0.5 (the thickness))) (the bend-BC reference-right) (* 0.5 (the-child width))) :front (* 0.5 (the width))) :orientation (alignment :top (the bend-BC reference-top) :right (the bend-BC reference-right))) (bend-BC :type 'bend :display-controls (list :color :green :transparency 0.5) :width (the width) :radius (the radius-BC) :angle (the angle-BC) :thickness (the thickness) :center (translate (the center) :right (* 0.5 (the length-XB)) :rear (* 0.5 (the width)))) (bend-AB :type 'bend :display-controls (list :color :green :transparency 0.5) :width (the width) :radius (the radius-AB) :angle (the angle-AB) :thickness (the thickness) :center (translate (the center) :left (* 0.5 (the length-XB)) :front (* 0.5 (the width))) :orientation (alignment :top (the (face-normal-vector :top)) :front (the (face-normal-vector :rear)))) (hole :type 'hole :hidden? (the hide-holes?) :sequence (:size (the number-of-holes)) :radius (the hole-radius) :line-length (* 3 (the thickness)) :center (translate (translate (the center) :rear (* (/ (- (the number-of-holes) 1) 2) (/ (the width) (the number-of-holes)))) :front (* (the-child index) (/ (the width) (the number-of-holes))))) (center-point :type 'sphere :hidden? t :radius 5 :display-controls (list :color :red)) (x-axis-left :type 'c-cylinder :hidden? t :end (make-point 35 0 0) :start (make-point 0 0 0) :display-controls (list :color :red) :radius 0.5) (y-axis-front :type 'c-cylinder :hidden? t :end (make-point 0 35 0) :start (make-point 0 0 0) :display-controls (list :color :blue) :radius 0.5) (z-axis-bottom :type 'c-cylinder :hidden? t :end (make-point 0 0 35) :start (make-point 0 0 0) :display-controls (list :color :green) :radius 0.5) )) (define-object bend (extruded-solid) :input-slots ((flat? nil :settable) (radius) (angle) (thickness) (width) (axis-vector (the (face-normal-vector :front))) ) :computed-slots ( (arc-center (translate (the center) :top (the radius))) (bend-allowance (* (+ (the radius) (* 0.5 (the thickness))) (degrees-to-radians (the angle)))) (distance (the width)) (curve1 (if (the flat?) (the upper-line) (the inner-arc))) (curve2 (if (the flat?) (the lower-line) (the outer-arc))) (side1 (make-object 'b-spline-curve :degree 1 :control-points (list (the curve1 start) (the curve2 start)))) (side2 (make-object 'b-spline-curve :degree 1 :control-points (list (the curve1 end) (the curve2 end)))) (profile (make-object 'composed-curve :curves (list (the curve1) (the side2) (the curve2) (the side1)))) (reference-top (rotate-vector-d (the (face-normal-vector :top)) (the angle) (the (face-normal-vector :front)))) (reference-right (rotate-vector-d (the (face-normal-vector :right)) (the angle) (the (face-normal-vector :front)))) (reference-point (the curve1 end)) ) :objects ( (inner-arc :type 'arc-curve :radius (the radius) :hidden? t :center (the arc-center) :orientation (alignment :top (the (face-normal-vector :front)) :right (the (face-normal-vector :bottom))) :start-angle 0 :end-angle (degrees-to-radians (the angle))) (outer-arc :type 'arc-curve :radius (+ (the radius) (the thickness)) :hidden? t :center (the arc-center) :orientation (alignment :top (the (face-normal-vector :front)) :right (the (face-normal-vector :bottom))) :start-angle 0 :end-angle (degrees-to-radians (the angle))) (upper-line :type 'b-spline-curve :hidden? t :degree 1 :control-points (list (the center) (translate (the center) :right (the bend-allowance)))) (lower-line :type 'boxed-curve :hidden? t :curve-in (the upper-line) :center (translate (the center) :bottom (the thickness))) )) (define-object hole (base-object) :input-slots ((line-length 0.5) (radius) ) :objects ((line :type 'b-spline-curve :degree 1 :control-points (list (translate (the center) :top (* 0.5 (the line-length))) (translate (the center) :bottom (* 0.5 (the line-length))))) (pt :type 'point :center (the center)) (cylinder :type 'cylinder-solid :display-controls (list :color :grey :transparency 0.8) :radius (the radius) :length (the line-length) :orientation (alignment :top (the (face-normal-vector :right)) :front (the (face-normal-vector :top)))))) (define-object box-solid-with-holes (transformed-solid) :input-slots ((width) (height) (length) (hole-brep-list)) :computed-slots ((brep (the (subtract-holes-from-box))) ) :objects ((box :type 'box-solid :hidden? t :pass-down (width length height)) #+nil (subtracted :type 'subtracted-solid :brep (the box) :other-brep (first (the hole-brep-list))) ) :functions ( (subtract-holes-from-box (&key (brep (the box)) (brep-list (the hole-brep-list))) (let* ((result) (new-brep)) (setq new-brep (make-object 'subtracted-solid :brep brep :other-brep (first brep-list))) (if (eql 1 (length brep-list)) (setq result new-brep) (setq result (the (subtract-holes-from-box :brep new-brep :brep-list (cdr brep-list))))) result))))
7,900
Common Lisp
.lisp
230
28.386957
125
0.618487
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
7f06bdd357e12910f38057e1fb6762878e314110b817507aea93fbd2df9ea2a9
35,622
[ -1 ]
35,623
bracket-test.lisp
lisp-mirror_gendl/regression/assembly-output/source/bracket-test.lisp
(in-package :bracket) (define-object bracket-test (base-object) :objects ((bracket :type 'simple-bracket)) :functions ((step-out! () (with-format (step "/tmp/try.stp" :assembly? t) (write-the bracket cad-output-tree)))))
239
Common Lisp
.lisp
8
26.625
91
0.681223
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
f1d9b7f2d755ef12638ac25cf7af754c89425f4c99de6b4af7d075cf0b836bd1
35,623
[ -1 ]
35,624
syntax-checker.lisp
lisp-mirror_gendl/regression/gdl/source/syntax-checker.lisp
(in-package :gdl-lift-tests) (define-condition not-raised (error) ;; Private condition to use inside assert-raises." ((expected-condition :initarg :expected-condition :reader expected-condition) (raised-condition :initarg :raised-condition :reader raised-condition :initform nil) (expression :initarg :expression :reader expression) (msg :initarg :msg :reader msg)) (:report (lambda (condition stream) (format stream "AssertionError: condition not raised. Message: ~a Expression: ~s Expected: '~s Raised: ~s Print: ~a" (msg condition) (expression condition) (expected-condition condition) (raised-condition condition) (raised-condition condition)) ))) (define-condition was-raised (error) ;; Private condition to use inside assert-raises." ((raised-condition :initarg :raised-condition :reader raised-condition) (expression :initarg :expression :reader expression) (msg :initarg :msg :reader msg)) (:report (lambda (condition stream) (format stream "AssertionError: condition was raised. Message: ~a Expression: ~s Raised: ~s Print: ~a" (msg condition) (expression condition) (raised-condition condition) (raised-condition condition) )))) (defmacro assert-raises (condition quoted msg) "Custom test for quoted `define-object expresssion. Check that condition is raised" `(handler-case (progn (eval ,quoted) ;; will be caught and re-raised (error 'not-raised)) (not-raised () (error 'not-raised :expected-condition ',condition :expression ,quoted :msg ,msg)) (,condition () t) (error (e) (error 'not-raised :expected-condition ',condition :raised-condition e :expression ,quoted :msg ,msg)) )) (defmacro assert-not-raises (quoted msg) "Custom test for quoted `define-object expresssion. Check that not condition is raised" `(handler-case (eval ,quoted) (error (e) (error 'was-raised :raised-condition e :expression ,quoted :msg ,msg)))) (defmacro defobj (key &rest body) "Make a quick define-object code for testing." ;; still return quoted, we eval later `(quote (define-object foo () ,key (,@body)))) (define-object syntax-error-test () ;; it's important that syntax-checking code and patches to define-object macros are loaded first!!! :computed-slots ((regression-test-data (let ((gdl::*on-syntax-error* :error)) ;; ############ ;; :input-slots ;; ############ (assert-not-raises (defobj :input-slots sym) "simple symbol") (assert-not-raises (defobj :input-slots "doc" sym) "docstring followed by symbol") (assert-not-raises (defobj :input-slots ("doc" sym)) "docstring followed by symbol") (assert-not-raises (defobj :input-slots ("doc" sym 2)) "with default") (assert-not-raises (defobj :input-slots ("doc" sym 2 :defaulting :settable)) "with behavior") (assert-raises gdl::syntax-error (defobj :input-slots 2) "Invalid token") (assert-raises gdl::syntax-error (defobj :input-slots (1 sym)) "Invalid doc token") (assert-raises gdl::syntax-error (defobj :input-slots ("doc" 1 sym)) "Invalid second doc token") (assert-raises gdl::syntax-error (defobj :input-slots (sym 1 :settable :nonsense)) "Invalid behavior") (assert-raises gdl::syntax-error (defobj :input-slots sym "free-floating") "free-floating string") ;; ############### ;; :computed-slots ;; ############### (assert-not-raises (defobj :computed-slots "doc" (sym)) "docstring followed by symbol") (assert-not-raises (defobj :computed-slots ("doc" sym)) "docstring followed by symbol") (assert-not-raises (defobj :computed-slots ("doc" sym 2)) "with default") (assert-not-raises (defobj :computed-slots ("doc" sym 2 :settable)) "with behavior") (assert-raises gdl::syntax-error (defobj :computed-slots 2) "Invalid token") (assert-raises gdl::syntax-error (defobj :computed-slots sym) "Symbol without default") (assert-raises gdl::syntax-error (defobj :computed-slots (1 sym)) "Invalid doc token") (assert-raises gdl::syntax-error (defobj :computed-slots ("doc" 1 sym)) "Invalid second doc token") (assert-raises gdl::syntax-error (defobj :computed-slots (sym 1 :nonsense)) "Invalid behavior") (assert-raises gdl::syntax-error (defobj :computed-slots sym "free-floating") "free-floating string") ;; ######## ;; :objects ;; ######## (assert-not-raises (defobj :objects ("doc" sym :type 'bar)) "valid :objects grammar") (assert-raises gdl::syntax-error (defobj :objects "doc") "invalid docstring") (assert-raises gdl::syntax-error (defobj :objects sym) "invalid symbol") (assert-raises gdl::syntax-error (defobj :objects 1) "invalid symbol") (assert-raises gdl::syntax-error (defobj :objects (1 sym)) "invalid docstring") (assert-raises gdl::syntax-error (defobj :objects ("doc" sym 1)) "invalid plist") ;; ########## ;; :functions ;; ########## (assert-not-raises (defobj :functions ("doc" sym :cached (bar) (+ bar 1))) "valid :functions grammar") (assert-raises gdl::syntax-error (defobj :functions "doc") "invalid docstring") (assert-raises gdl::syntax-error (defobj :functions sym) "invalid symbol position") (assert-raises gdl::syntax-error (defobj :functions 1) "invalid token") (assert-raises gdl::syntax-error (defobj :functions (1 sym)) "invalid doctring") (assert-raises gdl::syntax-error (defobj :functions ("doc" sym :nonsense)) "invalid behavior") (assert-raises gdl::syntax-error (defobj :functions ("doc" sym 2)) "invalid parameter list") ;; ################### ;; :trickle-down-slots ;; ################### (assert-not-raises (defobj :trickle-down-slots ) "valid :trickle-down-slots grammar") (assert-not-raises (defobj :trickle-down-slots bar baz) "valid :trickle-down-slots grammar") (assert-raises gdl::syntax-error (defobj :trickle-down-slots 1 2) "invalid tokens") (assert-raises gdl::syntax-error (defobj :trickle-down-slots (sym) sym) "invalid nesting") ;; ############## ;; :documentation ;; ############## (assert-not-raises (defobj :documentation ) "valid :documentation") (assert-not-raises (defobj :documentation :author "Reinier van Dijk" :description "some test") "valid :documentation") (assert-raises gdl::syntax-error (defobj :documentation 1) "invalid plist") (assert-raises gdl::syntax-error (defobj :documentation :nonsense 1) "invalid keywords") )))) ;; (register-test-definition 'syntax-error-test)
7,156
Common Lisp
.lisp
183
32.31694
124
0.631139
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
b5ba12a2f3535e99570b14d5f3bb1ec8add0ffda4d827dc8f34ceeaaf79d2264
35,624
[ -1 ]
35,625
center-loss.lisp
lisp-mirror_gendl/regression/tasty/source/center-loss.lisp
(in-package :gdl-user) (define-object tasty-center-test (base-object) :objects ((child1 :type 'box :center (make-point 1 0 0) :width 1 :length 1 :height 1) (child2 :type 'box :width 1 :length 1 :height 1)))
222
Common Lisp
.lisp
6
33.5
63
0.669767
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
eab37cc5ec94285d3ea63b49c938960aadbf3c9ad5ad90697c2c512ccb7916f2
35,625
[ -1 ]
35,626
package.lisp
lisp-mirror_gendl/regression/gwl/source/package.lisp
;; ;; Copyright 2002, 2012 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (gwl:define-package :gwl-lift-tests (:use :gdl-lift-utils))
903
Common Lisp
.lisp
21
41.714286
70
0.759954
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
f21bf5ec1c40ccdd0e0760bd7b1df74529e40b9720eed66cec311fdea55588a6
35,626
[ -1 ]
35,627
svg-error-handling.lisp
lisp-mirror_gendl/regression/gwl/source/svg-error-handling.lisp
(in-package :gdl-user) (define-object bad-box (box) :computed-slots ((length 10) (height 20) (width (div (the height) 0))))
136
Common Lisp
.lisp
6
19.666667
33
0.65625
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
2bacd175be32bdef0d20371b4e4e6e41cceb63a7f6c04b95215f79707cb20b0a
35,627
[ -1 ]
35,628
hey-now.lisp
lisp-mirror_gendl/regression/gwl/source/hey-now.lisp
;; ;; Copyright 2002, 2012 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gwl-user) (defparameter *locale-hash* (let ((strings `(:hey-now (:english "Hey Now" :chinese "嘿,现在")))) (let ((ht (make-hash-table :size (length strings)))) (mapc #'(lambda(key value) (setf (gethash key ht) value)) (plist-keys strings) (plist-values strings)) ht))) (defun locale-string (key) (gethash key *locale-hash*)) (define-object hey-now (base-ajax-sheet) :input-slots ((language-default :english)) :computed-slots ((lang (the language-choice value)) (html-sections (list (the main-section))) (main-sheet-body (with-cl-who-string () (str (the main-section main-div))))) :objects ((main-section :type 'sheet-section :inner-html (with-cl-who-string () (:p (str (the development-links))) (:p (:h1 (str (locale-string :hey-now)))) (:p (:fieldset (str (the language-choice html-string)))))) (language-choice :type 'menu-form-control :size 1 :prompt "Choose Language" :ajax-submit-on-change? t :default (the language-default) :choice-plist (list :english "English" :chinese "中国的")))) (publish-gwl-app "/hey-now" 'hey-now)
2,102
Common Lisp
.lisp
51
35.72549
71
0.673674
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
ac9bc5b7970d28879e912890e13699b09c878f85e4dd1ff28a258f2873b236fe
35,628
[ -1 ]
35,629
short-form-element-test.lisp
lisp-mirror_gendl/regression/gwl/source/short-form-element-test.lisp
;; ;; Copyright 2002-2011 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gwl-user) (define-object test-form-short (base-ajax-sheet) :computed-slots ((main-sheet-body (with-cl-who-string () (str (the development-links)) (str (the main-section main-div)) ))) :objects ((main-section :type 'short-main-section))) (define-lens (html-format test-form-short)()) (define-object short-main-section (base-ajax-sheet) :objects ((username :type 'text-form-control :size 35 :maxlength 30 :allow-nil? t :default "Ron Paul" :ajax-submit-on-change? t ))) (define-lens (html-format short-main-section)() :output-functions ((inner-html () (with-cl-who () (with-html-form (:cl-who? t) (str (the username html-string)) ((:input :type :submit :value " OK " ))))))) (publish-gwl-app "/fes" "gwl-user::test-form-short")
1,925
Common Lisp
.lisp
48
31.8125
71
0.642978
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
b29735ed6b25ae44c0fe4d0d6ec529d20e29e3c74c5772774c2e0c2f02ad393d
35,629
[ -1 ]
35,630
large-data.lisp
lisp-mirror_gendl/regression/gwl/source/large-data.lisp
;; ;; Copyright 2002, 2012 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; (roLanguage project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gwl-lift-tests) (define-object large-data (base-ajax-sheet) :computed-slots ((array-element-value (the array-element value)) (array-size-value (the array-size value)) (large-array (make-array (the array-size-value) :initial-element (the array-element-value))) (sum (progn (sleep 1) (reduce #'+ (the large-array)))) (html-sections (list (the main-section))) (main-sheet-body (with-cl-who-string () (str (the main-section main-div))))) :objects ((main-section :type 'sheet-section :inner-html (with-cl-who-string () (:p (str (the development-links))) (:p ((:span :id "gdlStatus") "Done.")) (:p (str (the sum))) (:p (:fieldset (str (the array-element html-string)) (str (the array-size html-string)))))) (array-element :type 'number-form-control :size 8 :prompt "Value for Array Element" :ajax-submit-on-change? t :default 10) (array-size :type 'number-form-control :size 8 :prompt "Value for Array Element" :ajax-submit-on-change? t :default 10000))) (publish-gwl-app "/large-data" 'large-data)
2,005
Common Lisp
.lisp
49
36.673469
95
0.68866
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
8a4085590037927aed248e20b180542513cd11f0ce3b31a145fc530a8cf92618
35,630
[ -1 ]
35,631
test-seq.lisp
lisp-mirror_gendl/regression/gwl/source/test-seq.lisp
;; ;; Copyright 2002-2011 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gwl-user) (define-object test-seq (base-html-sheet) :computed-slots ((ordered-form-controls (append (list (the number-of-choices)) (list-elements (the color-choices)) ))) :objects ((number-of-choices :type 'text-form-control :default 3 :allow-nil? nil :domain :number ) (color-choices :type 'menu-form-control :sequence (:size (the number-of-choices value)) :default :green :choice-list (list :red :green :blue)) (submit :type 'button-form-control :button-type :submit :default " OK "))) (define-lens (html-format test-seq)() :output-functions ((main-sheet () (with-cl-who() (:html (:head (:title "Hey Now")) (:body (the write-development-links) (:c (:h3 "Hey Now")) (with-html-form (:cl-who? t) (:p (str (the number-of-choices html-string))) (:p (dolist (choice (list-elements (the color-choices))) (htm (str (the-object choice html-string)) :br))) (:p (str (the submit html-string)))))))))) (publish-gwl-app "/test-seq" "gwl-user::test-seq")
2,396
Common Lisp
.lisp
56
31.017857
76
0.562172
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
f4651fb0400c193d4676385829d88309a3726287c5ec7169b320f091dc78e62e
35,631
[ -1 ]
35,632
form-element-tests.lisp
lisp-mirror_gendl/regression/gwl/source/form-element-tests.lisp
;; ;; Copyright 2002-2011 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gwl-user) (define-object test-form (base-ajax-sheet) :computed-slots ((force-validation-for (list (the radio-1) (the radio-2))) (session-duration 1) #+nil(grid-results (the grid-1 value)) ) :objects ((button-1 :type 'button-form-control :label "Hey Now" ) (radio-1 :type 'radio-form-control :default :orange :description-position :paragraph-prepend :validation-function #'(lambda(value) (member value (plist-keys (the-child choice-plist)))) :choice-plist (list :red "The color Red" :blue "The color Blue" :green "The color Green")) (radio-2 :type 'radio-form-control :default :maroon :description-position :paragraph-prepend :validation-function #'(lambda(value) (member value (plist-keys (the-child choice-plist)))) :choice-plist (list :red "The color Red" :blue "The color Blue" :green "The color Green")) (username :type 'text-form-control :size 35 :maxlength 30 :allow-nil? t :default "Ron Paul") (age :type 'text-form-control :size 5 :validation-function #'(lambda(input) (or (null input) (> 80 input 70))) :domain :number :default nil ) (bio :type 'text-form-control :rows 8 :size 120 :default " Congressman Ron Paul is the leading advocate for freedom in our nation's capital. As a member of the U.S. House of Representatives, Dr. Paul tirelessly works for limited constitutional government, low taxes, free markets, and a return to sound monetary policies. He is known among his congressional colleagues and his constituents for his consistent voting record. Dr. Paul never votes for legislation unless the proposed measure is expressly authorized by the Constitution. In the words of former Treasury Secretary William Simon, Dr. Paul is the one exception to the Gang of 535 on Capitol Hill.") (issues :type 'menu-form-control :choice-list (list "Taxes" "Health Care" "Foreign Policy") :default "Taxes" :ajax-submit-on-change? t :multiple? t) (color :type 'menu-form-control :size 7 :choice-styles (list :red "color: red;" :green "color: green;" :blue "color: blue;" :magenta "color: magenta;" :cyan "color: cyan;" :yellow "color: yellow;" :orange "color: orange;") :choice-plist (list :red "red" :green "green" :blue "blue" :magenta "magenta" :cyan "cyan" :yellow "yellow" :orange "orange") :validation-function #'(lambda(color) (if (intersection (ensure-list color) (list :yellow :magenta)) (list :error :disallowed-color-choice) t)) :multiple? t :default :red) (early-riser? :type 'checkbox-form-control :default nil) (favorite-links :type 'text-form-control :sequence (:size 3) :size 70 :default "http://") (form-1 :type 'menu-form-control :default nil :domain :number :multiple? t :choice-list (when t (list 1 2 3 4 5)) :choice-plist (when nil (list :a 5 :b 6 :c 7))) (list-choices :type 'menu-form-control :default '(:A36 nil 35000 12000) :choice-plist '((:A36 nil 35000 12000) :A36 (:A40 nil nil 45000) :A40 (:ST43 nil nil) :ST43)) (number-of-grid-columns :type 'text-form-control :default 3 :allow-invalid? nil :validation-function #'(lambda(value) (if (and (integerp value) (<= 1 value 3)) t (list :validated-value nil :error "Must be between 1 and 3"))) :prompt "columns: ") ;;;; (grid-1 :type 'grid-form-control ;;;; :include-delete-buttons? nil ;;;; :keys (subseq (list :col-a :col-b :col-c) ;;;; 0 (the number-of-grid-columns value)) ;;;; :row-labels (list "<i>take-off angle</i>" ;;;; "take-off gap" ;;;; "take-off overlap" ;;;; "landing angle" ;;;; "landing gap" ;;;; ) ;;;; :default (make-list 5 ;;;; :initial-element ;;;; (make-list (the number-of-grid-columns ;;;; value) ;;;; :initial-element nil))) ;;;; (reason :type 'text-form-control :rows 5 :cols 100 :domain :string :validation-function #'(lambda(input) (if (< (length input) 4) (list :error "Error: A reason for rejection is required") t)) :default ""))) (define-lens (html-format test-form)() :output-functions ((main-sheet-body () (with-html-output (*stream* nil :indent t) (:h2 (:center "Test Form")) (the write-development-links) (with-html-form (:cl-who? t) (:p (str (the age html-string))) (:p (str (the button-1 html-string))) (:p (str (the radio-1 html-string))) (:p (str (the radio-2 html-string))) (:p (str (the reason html-string))) (:p (str (the username html-string))) (:p "(internal value is: " (fmt "~s" (the username value)) ")") (:p (str (the age html-string))) (:p "(internal value is: " (fmt "~s" (the age value)) ")") (:p (str (the bio html-string))) (:p (:table (:tr (:td (str (the issues html-string)))) (:tr (:td (str (the color html-string)))) (:tr (:td (str (the color value)))) (:p (str (the early-riser? html-string))) (dolist (link (list-elements (the favorite-links))) (htm (str (the-object link html-string)))) (:p (str (the number-of-grid-columns html-string))) (:table (:tr (:td ((:table :border 1) (:tr (:td " " :br)) (:tr (:td "take-off angle")) (:tr (:td "take-off gap")) (:tr (:td "take-off overlap")))) (:td #+nil(str (the grid-1 form-control-string))))) (:p #+nil(str (the grid-1 value))) (:p (str (the form-1 html-string))) (:p (str (the list-choices html-string))) (:p (fmt "~s" (the list-choices value))) (:p ((:input :type :submit :value " OK ")))))))))) (publish-gwl-app "/fe" "gwl-user::test-form")
9,143
Common Lisp
.lisp
191
32.209424
98
0.493967
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
1c527a047d98b53e818380cc6a7e98eb16d3fd3aa75774c82ee6b08f5a1ee558
35,632
[ -1 ]
35,633
form-element-validation.lisp
lisp-mirror_gendl/regression/gwl/source/form-element-validation.lisp
;; ;; Copyright 2002-2011 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gwl-user) (define-object validation-test (base-ajax-sheet) :objects ((radio-1 :type 'radio-form-control :default :orange :description-position :paragraph-prepend :validation-function #'(lambda(value) (member value (plist-keys (the-child choice-plist)))) :choice-plist (list :red "The color Red" :blue "The color Blue" :green "The color Green")) ("user-management-text-form-control. Form control for users first name. Required input, minimum length 2 characters" first-name-input :type 'text-form-control :size 20 :validation-function #'(lambda(val) (cond ((not val) (list :error "Error: First name must be specified")) ((<= (length val) 2) (list :error "Error: First name must be more than 2 characters long")) (t t))) :default "a") (age :type 'text-form-control :size 5 :validation-function #'(lambda(input) (if (null input) (list :error "Error Message") t)) :domain :number :default nil))) (define-lens (html-format validation-test)() :output-functions ((main-sheet () (html (:h2 (:center "Test Form")) (the write-development-links) (:table (with-html-form () (:tr (:td "colour") (:td (:princ (the radio-1 form-control-string)))) (:tr (:td "first name") (:td (:princ (the first-name-input form-control-string))) (when (the first-name-input error ) (html (:td (:princ (the first-name-input error)))))) (:tr (:td "age") (:td (:princ (the age form-control-string))) (when (the age error ) (html (:td (:princ (the age error)))))) (:tr (:td ((:input :type :submit :value " OK ")))))))))) (publish-gwl-app "/vt" "gwl-user::validation-test")
3,153
Common Lisp
.lisp
68
34.117647
114
0.565987
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
3539f4004e3b5bd3d5ce8ca9f8d0597adf34f4e40252941527565e7bc8a3ad65
35,633
[ -1 ]
35,634
ajax-json.lisp
lisp-mirror_gendl/regression/gwl/source/ajax-json.lisp
(in-package :gwl-user) (define-object ajax-json-test (base-ajax-sheet) :computed-slots ((use-jquery? t) (main-sheet-body (with-cl-who-string () (str (the Main-Section main-div))))) :objects ((Main-Section :type 'sheet-section :inner-html (with-cl-who-string () (str (the development-links)) (str (the Application-Domain html-string)) :br "Current value: " (str (the Application-Domain value)) :br (str (the send form-control-string)))) (Application-Domain :type 'text-form-control :size 35 :maxlength 30 :allow-nil? t :default "Engineering") (send :type 'button-form-control :label "Send" :onclick ;;(the (ajax-json.js :form-controls (list (the Application-Domain)))) (the (gdl-ajax-call :form-controls (list (the Application-Domain))))))) (publish-gwl-app "/ajt" 'ajax-json-test)
925
Common Lisp
.lisp
25
30.24
80
0.632054
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
46ce4a1e591ce1af134bcd6700c8b268e4b52c36aeffd6544b8fd563c44bd313
35,634
[ -1 ]
35,635
issue-65.lisp
lisp-mirror_gendl/regression/issues/source/issue-65.lisp
(in-package :gdl-user) (define-object manifold-sample (base-object) :objects ((box :type 'box-solid :width 2 :length 2 :height 2) (merged :type 'merged-solid :other-brep (the box :face-breps :list-elements)) ("merge trial" merged2 :type 'merged-solid :other-brep (the box :face-breps :list-elements) :make-manifold? t)))
357
Common Lisp
.lisp
10
31.1
80
0.674419
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
b71cec561992f34b71f2c9b88067a51e550c9b3b6b6636108a5ee8c9c78c64cc
35,635
[ -1 ]
35,636
issue-67.lisp
lisp-mirror_gendl/regression/issues/source/issue-67.lisp
(in-package :gdl-user) (define-object issue-67 (base-object) :objects ((box :type 'box-solid :width 2 :length 2 :height 2) (clean-surfaces :type 'surface :sequence (:size 6) :built-from (the box (faces (the-child index)) basis-surface)) (stitched :type 'stitched-solid :faces-in (list-elements (the clean-surfaces))) (stitched-alternative :type 'stitched-solid :faces-in (list-elements (the box :faces) (the-element basis-surface))) (stitched-manifold :type 'manifold-solid :brep (the stitched))))
531
Common Lisp
.lisp
11
44.272727
118
0.710117
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
d9e729a65377f58efad30b207c04aa23e125ab80e29a1e1c985e0632b50c525d
35,636
[ -1 ]
35,637
issue-68.lisp
lisp-mirror_gendl/regression/issues/source/issue-68.lisp
(in-package :gdl-user) ;; ;; Submitted by Hermen de Jong of KE-works ;; (define-object huge-boxes-sequence (base-object) :input-slots ((number-of-boxes 100 :settable)) :computed-slots ((wall-width (floor (sqrt (the number-of-boxes))))) :objects ((boxes :type 'box :sequence (:size (the number-of-boxes)) :height 10 :width 20 :length 30 :display-controls (list :color :red :transparency .5) :center (translate (make-point 0 0 0) :right (* (rem (the-child index) (the wall-width)) (the-child width)) :top (* (floor (the-child index) (the wall-width)) (the-child height))))))
662
Common Lisp
.lisp
23
23.913043
56
0.626772
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
7a964cee6117bd952067866f611697c2d10e867e3d62693209ac00051bf6ff88
35,637
[ -1 ]
35,638
syntax.lisp
lisp-mirror_gendl/regression/base/syntax.lisp
(in-package :gdl-user) (define-object-macro-toplevel :super-inputs (messages) `(:input-slots ,messages)) (define-object toplevel () :super-inputs (hey now)) (define-object broken () :silly-inputs (hey now))
218
Common Lisp
.lisp
7
28.571429
54
0.728155
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
be47381b8712ceb7bef852a37b96e9d9ecd9b4a39f0f25da371d37c6700e7520
35,638
[ -1 ]
35,639
variable-sequence.lisp
lisp-mirror_gendl/regression/base/variable-sequence.lisp
(in-package :gdl-user) (define-object container () :objects ((kids :type 'vkid :sequence (:indices nil)))) (define-object vkid () :computed-slots ((a nil :settable) (b nil :settable)))
205
Common Lisp
.lisp
8
22.125
31
0.668421
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
5acafd1c1169225645810408b0f06a4dbc8f909f3a51aa2c4a6d9599eeb61f71
35,639
[ -1 ]
35,640
box-solid.lisp
lisp-mirror_gendl/regression/threads/source/box-solid.lisp
(in-package :gdl-lift-tests) #+allegro (defparameter *box-solid-lock* (mp:make-process-lock :name "box-solid-lock")) #+allegro (defparameter *collected-breps* nil) #+allegro (defparameter *collected-breps-old* nil) #+allegro (defun make-and-check-box-solid (&key (value 20) (n nil)) (let (self) (mp:with-process-lock (smlib::*smlib-lock*) (setq self (make-object 'box-solid :length value :width value :height value)) (the %native-brep%)) (mp:with-process-lock (smlib::*smlib-lock*) (unless (near-to? (the volume) (expt value 3)) (error "box dimensions got reset out from under us! Should be ~a and it is now ~a~a~%" (expt value 3) (the volume) (if n (format nil " and n is ~a." n) "")))))) #+allegro (defun delete-collected-breps () (mp:process-run-function "delete-breps" #'(lambda() (dolist (brep *collected-breps*) (mp:with-process-lock (smlib::*smlib-lock*) (smlib::delete-iwbrep brep)))))) #+allegro (defun start-box-threads (&key (times 2000)) (let ((*geometry-kernel* (make-instance (read-from-string "smlib::geometry-kernel") :iw-context (funcall (read-from-string "smlib::make-iw-context"))))) (mp:process-run-function "box-20" #'(lambda()(dotimes (n times) (when (zerop (mod n 100)) (format t "In 20-setter, n is: ~a~%" n)) (make-and-check-box-solid :value 20 :n n))))) (let ((*geometry-kernel* (make-instance (read-from-string "smlib::geometry-kernel") :iw-context (funcall (read-from-string "smlib::make-iw-context"))))) (mp:process-run-function "num-42" #'(lambda()(dotimes (n times) (when (zerop (mod n 100)) (format t "In 24-setter, n is: ~a~%" n)) (make-and-check-box-solid :value 24 :n n))))) (let ((*geometry-kernel* (make-instance (read-from-string "smlib::geometry-kernel") :iw-context (funcall (read-from-string "smlib::make-iw-context"))))) (mp:process-run-function "num-42" #'(lambda()(dotimes (n times) (when (zerop (mod n 100)) (format t "In 42-setter, n is: ~a~%" n)) (make-and-check-box-solid :value 42 :n n))))))
2,168
Common Lisp
.lisp
47
40.297872
90
0.628979
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
1e4333492b6079914bb24b14df17570abfcd25bdf1b921e50e13b80bae332bde
35,640
[ -1 ]
35,641
remote.lisp
lisp-mirror_gendl/regression/dgdl/source/remote.lisp
(in-package :gdl-user) #| To use: 1. (setq *compile-for-dgdl?* t) 2. Compile & load this file in the "primary" Gendl session. 3. Start a separate Gendl session (this should start by default on 9001) 4. compile & load this file in the "secondary" Gendl session *compile-for-dgdl?* should not be necessary on the secondary session but will not hurt. 5. On the primary session, try: (make-self 'container) (the remote-1 slot-1) This should return "one" |# (eval-when (:compile-toplevel :load-toplevel :execute) (setq *compile-for-dgdl?* t)) (define-object container () :objects ((remote-1 :type 'remote-object :remote-type 'remote-1 :port 9003 :host "localhost"))) (define-object remote-1 () :computed-slots ((slot-1 "one"))) (eval-when (:compile-toplevel :load-toplevel :execute) (setq *compile-for-dgdl?* nil))
886
Common Lisp
.lisp
26
30.153846
78
0.688679
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
e6b0df9e1c5b8f0a059c8a30f98e886f560ef656760c2fea8a35037503f32845
35,641
[ -1 ]
35,642
pegasus-regioned-solid.lisp
lisp-mirror_gendl/regression/source/pegasus-regioned-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object pegasus-regioned-solid-test (base-object) :computed-slots ((regression-test-data (mapcar #'(lambda(brep) (let ((properties-tolerance (* 1.0e-5 (the-object brep max-extent)))) (append (multiple-value-list (the-object brep (precise-properties :tolerance properties-tolerance))) (the-object brep %curves-to-draw%) (the-object brep %lines-to-draw%)))) (list-elements (the regioned breps))))) :objects ((subtracted :type 'native-reader :file-name (merge-pathnames "pegasus-subtracted.iwp" gdl-lift-utils::*lift-data-directory*)) (regioned :type 'regioned-solid :brep (the subtracted (breps 0))))) ;; (register-test-definition 'pegasus-regioned-solid-test)
1,661
Common Lisp
.lisp
37
40.837838
109
0.716677
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
65bfcf681c0210cecfb551d1bc58cc569ace33685dd9febd073a7930cae2331e
35,642
[ -1 ]
35,643
transformed-solid.lisp
lisp-mirror_gendl/regression/source/transformed-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object transformed-solid-test (transformed-solid) :computed-slots ((brep (the solid)) (to-location (make-point 10 0 0)) (scale (make-vector 2.0 2.0 2.0)) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%)))) :objects ((solid :type 'surf::box-solid :length 10 :width 20 :height 15))) (register-test-definition 'transformed-solid-test)
1,384
Common Lisp
.lisp
33
38.242424
80
0.721595
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
9394745201dbce73a68adc44f172ec42b3d8c1b4cb5a0989d4e9fd65ba7ce573
35,643
[ -1 ]
35,644
merged-solid.lisp
lisp-mirror_gendl/regression/source/merged-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object box-faces (base-object) :objects ((top-face :type 'planar-surface :p00 (the box (vertex :top :right :rear)) :p01 (the box (vertex :top :right :front)) :p10 (the box (vertex :top :left :rear)) :p11 (the box (vertex :top :left :front))) (bottom-face :type 'planar-surface :p00 (the box (vertex :bottom :right :rear)) :p01 (the box (vertex :bottom :right :front)) :p10 (the box (vertex :bottom :left :rear)) :p11 (the box (vertex :bottom :left :front))) (right-face :type 'planar-surface :p00 (the box (vertex :top :right :rear)) :p01 (the box (vertex :top :right :front)) :p10 (the box (vertex :bottom :right :rear)) :p11 (the box (vertex :bottom :right :front))) (left-face :type 'planar-surface :p00 (the box (vertex :top :left :rear)) :p01 (the box (vertex :top :left :front)) :p10 (the box (vertex :bottom :left :rear)) :p11 (the box (vertex :bottom :left :front))) (rear-face :type 'planar-surface :p00 (the box (vertex :top :right :rear)) :p01 (the box (vertex :top :left :rear)) :p10 (the box (vertex :bottom :right :rear)) :p11 (the box (vertex :bottom :left :rear))) (front-face :type 'planar-surface :p00 (the box (vertex :top :right :front)) :p01 (the box (vertex :top :left :front)) :p10 (the box (vertex :bottom :right :front)) :p11 (the box (vertex :bottom :left :front))))) (define-object merged-solid-test (merged-solid) :computed-slots ((length 20) (width 10) (height 10) (sew-and-orient? nil) (other-brep (list (the box-faces top-face) (the box-faces bottom-face) (the box-faces right-face) (the box-faces left-face) (the box-faces rear-face) (the box-faces front-face))) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%)))) :hidden-objects ((box :type 'box) (box-faces :type 'box-faces))) (register-test-definition 'merged-solid-test) (define-object merged-solid-test-bt (surf::boolean-tree) :computed-slots ((length 20) (width 10) (height 10) (sew-and-orient? nil) (breps (list (the box-faces top-face brep) (the box-faces bottom-face brep) (the box-faces right-face brep) (the box-faces left-face brep) (the box-faces rear-face brep) (the box-faces front-face brep))) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%)))) :hidden-objects ((box :type 'box) (box-faces :type 'box-faces))) (register-test-definition 'merged-solid-test-bt) ;; ;; FLAG -- try a sewn-solid or stitched-solid. ;; #+nil (define-object merged-solid-test (merged-solid) :computed-slots ((width 20) (length 20) (height 20) (sew-and-orient? nil) (brep (the plane1 brep)) (other-brep (the plane2 brep))) :objects ((plane1 :type 'planar-surface :width 20 :length 20 :p00 (translate (the center) :left (half (the width)) :rear (half (the length))) :p01 (translate (the center) :left (half (the width)) :front (half (the length))) :p10 (translate (the center) :right (half (the width)) :rear (half (the length))) :p11 (translate (the center) :right (half (the width)) :front (half (the length)))) (plane2 ::type 'planar-surface :width 20 :height 20 :p00 (translate (the center) :left (half (the width)) :bottom (half (the height))) :p01 (translate (the center) :left (half (the width)) :top (half (the height))) :p10 (translate (the center) :right (half (the width)) :bottom (half (the height))) :p11 (translate (the center) :right (half (the width)) :top (half (the height))))))
4,882
Common Lisp
.lisp
112
37.446429
88
0.650538
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
52d09a0a241dbd5b601dc874d518e1be2a4e15d32068856128db8288b7fcf63a
35,644
[ -1 ]
35,645
step-writer.lisp
lisp-mirror_gendl/regression/source/step-writer.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object step-writer-test (base-object) :computed-slots ((output-file-name (let ((output (merge-pathnames "round-trip.stp" gdl-lift-utils::*lift-data-directory*))) (with-format (step output) (write-the test-part (breps 0) cad-output)) output)) (regression-test-data (append (multiple-value-list (the input (breps 0) precise-properties)) (the input (breps 0) %curves-to-draw%) (the input (breps 0) %lines-to-draw%)))) :objects ((test-part :type 'native-reader :file-name (merge-pathnames "iraro.iwp" gdl-lift-utils::*lift-data-directory*)) (input :type 'step-reader :file-name (the output-file-name) :make-single-brep? t))) (register-test-definition 'step-writer-test)
1,693
Common Lisp
.lisp
38
39.947368
93
0.702257
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
de0b4f209c74b674e6d32c45bd59b265254dfd97b0bb99b06178c66bf2677f89
35,645
[ -1 ]
35,646
regioned-solid.lisp
lisp-mirror_gendl/regression/source/regioned-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object regioned-solid-test (base-object) :computed-slots ((points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0)) ((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2)) ((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4)) ((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7)))) (regression-test-data (mapcar #'(lambda(brep) (append (multiple-value-list (the-object brep precise-properties)) (the-object brep %curves-to-draw%) (the-object brep %lines-to-draw%))) (list-elements (the regioned breps))))) :objects ((b-spline-capped-surface :type 'b-spline-surface :control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data)) :end-caps-on-brep? t ;;:end-caps-on-brep? nil :sew-and-orient-brep? t) (b-spline-solid :type 'brep :%native-brep% (the b-spline-capped-surface brep %native-brep%)) (rectangular-surface :type 'rectangular-surface :width 10 :length 4 :height 0 :center (translate (the :center) :up (half (the b-spline-capped-surface :height)) :right (half (the b-spline-capped-surface :width)))) (subtracted :type 'subtracted-solid :error-on-invalid? nil :brep (the b-spline-solid) :other-brep (the rectangular-surface)) (regioned :type 'regioned-solid :brep (the subtracted)))) ;;(register-test-definition 'regioned-solid-test)
2,653
Common Lisp
.lisp
52
41.096154
107
0.591805
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
a12e5a1c4ca1df410216f3f080b8ec20be074bcee7b4653958275c51d9217f40
35,646
[ -1 ]
35,647
general-note.lisp
lisp-mirror_gendl/regression/source/general-note.lisp
(in-package :gdl-lift-tests) (define-object general-note-test (base-object) :objects ( (center-sphere :type 'sphere :radius .1) (note :type 'general-note :display-controls (list :color (list .32 .54 .26) :specular-color (list 0.46 0.46 0.46) :ambient-intensity 0.0933 :billboard t) :strings "Hey Now") (kid :type 'general-note-kid :center (translate (the center) :rear 10)) )) (define-object general-note-kid (base-object) :objects ((center-sphere :type 'sphere :radius .1) (note :type 'general-note :display-controls (list :color (list .32 .54 .26) :billboard t :specular-color (list 0.46 0.46 0.46) :ambient-intensity 0.0933) :strings "Hey Now kid") ))
752
Common Lisp
.lisp
26
24.192308
51
0.661932
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
71b484ffe5ce6b9671e2b74d24add5f2b56342dade0b010703658471be15bd2c
35,647
[ -1 ]
35,648
cylinder-solid.lisp
lisp-mirror_gendl/regression/source/cylinder-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object cylinder-solid-test (cylinder-solid) :computed-slots ((length 100) (radius 20) (inner-radius 16) (regression-test-data (append (multiple-value-list (the (precise-properties :tolerance 0.00001))) (the %curves-to-draw%) (the %lines-to-draw%))))) (register-test-definition 'cylinder-solid-test)
1,267
Common Lisp
.lisp
30
38.633333
101
0.729064
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
1a141609edccfd0014bdb6cfe426f58c9e12f39a3060c506bcf3f6f392843a94
35,648
[ -1 ]
35,649
package.lisp
lisp-mirror_gendl/regression/source/package.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (gdl:define-package :gdl-lift-tests (:use :gdl-lift-utils))
920
Common Lisp
.lisp
21
42.47619
70
0.760045
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
0f25410e7674434cc35910afa4b7dde97c414cff1014241d40de3547b0f586cf
35,649
[ -1 ]
35,650
orientations.lisp
lisp-mirror_gendl/regression/source/orientations.lisp
;; ;; Copyright 2012 Genworks International ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object orientations (base-object) :input-slots ((max-depth 2) (depth 0) (length 5) (width 15) (height 2) (display-controls (list :color :grey :transparency 0.7))) :objects ((left-box :type (if (> (the depth) (the max-depth)) 'null-part 'orientations ) :display-controls (list :line-thickness 2 :color :red :transparency 0.5) :max-depth (the max-depth) :depth (1+ (the depth)) :center (translate (the center) :left (- (half (the width)) (half (the-child width)))) :length (half (the length)) :width (half (the width)) :height (half (the height)) :orientation (alignment :rear (rotate-vector-d (the (face-normal-vector :rear)) 45 (the (face-normal-vector :right))) :right (the (face-normal-vector :right)) #+nil (rotate-vector-d (the (face-normal-vector :right)) 20 (the (face-normal-vector :top))))) (right-box :type (if (> (the depth) (the max-depth)) 'null-part 'orientations) :display-controls (list :color :green :transparency 0.5) :max-depth (the max-depth) :depth (1+ (the depth)) :center (translate (the center) :right (- (half (the width)) (half (the-child width)))) :length (half (the length)) :width (half (the width)) :height (half (the height)) :orientation (alignment :rear (rotate-vector-d (the (face-normal-vector :rear)) 45 (the (face-normal-vector :right))) :right (the (face-normal-vector :right)) #+nil (rotate-vector-d (the (face-normal-vector :left)) 20 (the (face-normal-vector :bottom))))) (axis :type 'axes ) (box :type 'box) )) (define-object axes (base-object) :input-slots ((length 10 :defaulting) (width 10 :defaulting) (height 10 :defaulting)) :objects ((x-line :type 'c-cylinder :radius 0.1 :start (the center) :end (translate (the-child start) :right (the width)) :display-controls (list :color :red)) (y-line :type 'c-cylinder :radius 0.1 :start (the center) :end (translate (the-child start) :rear (the length)) :display-controls (list :color :green)) (z-line :type 'c-cylinder :radius 0.1 :start (the center) :end (translate (the-child start) :top (the height)) :display-controls (list :color :blue))))
3,284
Common Lisp
.lisp
79
35.759494
94
0.650047
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
f3cd04b626920ff6007ca12b4ddec0f818a1ff65f540069c878ef4ffcd2261ce
35,650
[ -1 ]
35,651
iges-writer.lisp
lisp-mirror_gendl/regression/source/iges-writer.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object iges-writer-test (base-object) :computed-slots ((output-file-name (let ((output (merge-pathnames "round-trip.igs" gdl-lift-utils::*lift-data-directory*))) (with-format (iges output) (write-the test-part (breps 0) cad-output)) output)) #+nil (regression-test-data (progn (warn "Iges-writer-test is failing, check input of type iges-reader") nil)) ;;#+nil (regression-test-data (append (multiple-value-list (the input (breps 0) precise-properties)) (the input (breps 0) %curves-to-draw%) (the input (breps 0) %lines-to-draw%)))) :objects ((test-part :type 'native-reader :file-name (merge-pathnames "iraro.iwp" gdl-lift-utils::*lift-data-directory*)) (input :type 'iges-reader :file-name (the output-file-name) :make-single-brep? t ))) (define-object iges-writer-test-2 (base-object) :computed-slots ((output-file-name (let ((output (merge-pathnames "round-trip-2.igs" gdl-lift-utils::*lift-data-directory*))) (with-format (iges output) (write-the test-part (breps 0) cad-output)) output)) (regression-test-data (append (multiple-value-list (the input (breps 0) precise-properties)) (the input (breps 0) %curves-to-draw%) (the input (breps 0) %lines-to-draw%)))) :objects ((test-part :type 'iges-reader :make-single-brep? t :file-name (merge-pathnames "nurb_fillet.igs" gdl-lift-utils::*lift-data-directory*)) (input :type 'iges-reader :file-name (the output-file-name) :make-single-brep? t))) (register-test-definition 'iges-writer-test) (register-test-definition 'iges-writer-test-2) ;; ;; Output tests ;; (define-object iges-test-tree (base-object) :objects ((b-spline-curve :type 'test-b-spline-curves) (fitted-curve :type 'test-fitted-curve) ;(arc-curve :type 'test-arc-curve) (linear-curve :type 'test-linear-curve) ;(curve-from-line :type 'l-line :start (make-point 0 0 0) ; :end (make-point 10 10 0)) (curve-from-arc :type 'arc :center (make-point 0 0 0) :radius 10 :start-angle 0 :end-angle pi) (b-spline-surface :type 'test-b-spline-surface) (fitted-surface :type 'test-fitted-surface) (planar-surface :type 'test-planar-surface) (rectangular-surface :type 'test-rectangular-surface) (spherical-surface :type 'test-spherical-surface) (spherical-surface-2 :type 'spherical-surface :radius 0.5) (spherical-surface-3 :type 'spherical-surface :radius 0.05) (spherical-surface-4 :type 'spherical-surface :radius 0.005) ) :functions ((iges-out () (let ((output-file (make-pathname :directory (pathname-directory (glisp:temporary-folder)) :name "iges-test-tree" :type "iges"))) (format t "Writing test IGES file to ~a...~%" output-file) (with-format (iges output-file) (write-the cad-output-tree)))))) (define-object set-of-points (base-object) :input-slots ((centers (list (the center) (translate (the center) :right 1) (translate (the center) :left 1) (translate (the center) :rear 1) (translate (the center) :front 1) (translate (the center) :up 1) (translate (the center) :down 1)))) :objects ( (points :type 'point :sequence (:size (length (the centers))) :center (nth (the-child index) (the centers))) (surface :type 'test-b-spline-surface)) :functions ((iges-out () (let ((output-path (merge-pathnames "points.iges" (glisp:temporary-folder)))) (with-format (iges output-path) (write-the cad-output-tree)) output-path))))
4,872
Common Lisp
.lisp
116
34.724138
100
0.640555
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
e5b6dd65afa8c3a97ba03527e88adc6f0b9b1b81eaac0981495d7c8d8c9bcfcb
35,651
[ -1 ]
35,652
trimmed-surface.lisp
lisp-mirror_gendl/regression/source/trimmed-surface.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object trimmed-surface-test (trimmed-surface) :computed-slots ((basis-surface (the b-spline-surface)) (holes (list (the hole))) (uv-inputs t) (reverse-island? t) (reverse-holes? t) (points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0)) ((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2)) ((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4)) ((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7)))) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%))) ) :objects ((b-spline-surface :type 'b-spline-surface :control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data))) (island :type 'b-spline-curve :control-points (list (make-point 0 0 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (hole :type 'b-spline-curve :control-points (list (make-point 0.5 0.5 0) (make-point 0.5 0.75 0) (make-point 0.75 0.75 0) (make-point 0.75 0.5 0) (make-point 0.5 0.5 0))))) (register-test-definition 'trimmed-surface-test) (define-object test-trimmed-surface (trimmed-surface) :computed-slots ((holes (list (the hole))) (uv-inputs t) (reverse-island? t) (reverse-holes? t) (display-controls (list :color :periwinkle :line-thickness 2))) :hidden-objects ((basis-surface :type 'test-b-spline-surface) (island :type 'b-spline-curve :control-points (list (make-point 0 0 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (hole :type 'b-spline-curve :control-points (list (make-point 0.5 0.5 0) (make-point 0.5 0.75 0) (make-point 0.75 0.75 0) (make-point 0.75 0.5 0) (make-point 0.5 0.5 0))) (view :type 'base-view :projection-vector (getf *standard-views* :trimetric) :width (* 5 72) :length (* 5 72) :objects (list self)))) (define-object test-planar-surface (planar-surface) :computed-slots ((display-controls (list :color :fuchsia :transparency 0.5)) (p00 (make-point 0 0 0)) (p01 (make-point 0 1 0)) (p10 (make-point 1 0 0)) (p11 (make-point 1.5 1.5 0)))) (define-object test-sub (base-object) :objects ((basis :type 'test-planar-surface :display-controls (list :color :grey-light-very)) (hole :type 'global-filleted-polyline-curve :default-radius .05 :vertex-list (list (make-point 0.5 0.5 -.05) (make-point 0.75 0.5 -.05) (make-point 0.75 0.75 -.05) (make-point 0.5 0.75 -.05) (make-point 0.5 0.5 -.05))) (subtract :type 'subtracted-solid :brep (the basis brep) :display-controls (list :color :blue) :other-brep (the extrude)) (extrude :type 'extruded-solid :distance .1 :profile (the hole)))) (define-object test-trimmed-surface-3 (trimmed-surface) :computed-slots ((reverse-holes? t) ;;(island (the island-container ordered-curves)) ;;(island nil) (reverse-island? t) (holes (list (the hole ordered-curves))) (display-controls (list :color :periwinkle :line-thickness 2))) :hidden-objects ((basis-surface :type 'test-planar-surface :display-controls (list :color :grey-light-very)) (island-container :type 'global-filleted-polyline-curves :default-radius .05 :vertex-list (list (make-point 0 0 0) (make-point 0.3 0.6 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (island-2 :type 'b-spline-curve :control-points (list (make-point 0 0 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (hole :type 'global-filleted-polyline-curves :default-radius .05 :vertex-list (list (make-point 0.5 0.5 0) (make-point 0.75 0.5 0) (make-point 0.75 0.75 0) (make-point 0.5 0.75 0) (make-point 0.5 0.5 0))))) #+nil (define-object test-trimmed-surface-2 (trimmed-surface) :computed-slots ((uv-inputs t) (reverse-holes? t) (island (the island-container ordered-curves)) (holes (list (the hole ordered-curves))) (display-controls (list :color :periwinkle :line-thickness 2))) :hidden-objects ((basis-surface :type 'test-planar-surface) (island-container :type 'global-filleted-polyline-curves :default-radius 0.05 :vertex-list (list (make-point 0 0 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (island-2 :type 'b-spline-curve :control-points (list (make-point 0 0 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (hole :type 'global-filleted-polyline-curves :default-radius 0.05 :vertex-list (list (make-point 0.5 0.5 0) (make-point 0.75 0.5 0) (make-point 0.75 0.75 0) (make-point 0.5 0.75 0) (make-point 0.5 0.5 0))) (view :type 'base-view :projection-vector (getf *standard-views* :trimetric) :page-width (* 5 72) :page-length (* 5 72) :objects (list self)))) #+nil (define-object test-trimmed-surface-3 (trimmed-surface) :computed-slots ((reverse-holes? t) (island (the island-container ordered-curves)) (holes (list (the hole ordered-curves))) (display-controls (list :color :periwinkle :line-thickness 2))) :hidden-objects ((basis-surface :type 'test-planar-surface :display-controls (list :color :grey-light-very)) (island-container :type 'global-filleted-polyline-curves :default-radius .05 :vertex-list (list (make-point 0 0 0) (make-point 0.3 0.6 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (island-2 :type 'b-spline-curve :control-points (list (make-point 0 0 0) (make-point 0 1 0) (make-point 1 1 0) (make-point 1 0 0) (make-point 0 0 0))) (hole :type 'global-filleted-polyline-curves :default-radius .05 :vertex-list (list (make-point 0.5 0.5 0) (make-point 0.75 0.5 0) (make-point 0.75 0.75 0) (make-point 0.5 0.75 0) (make-point 0.5 0.5 0))) (view :type 'base-view :projection-vector (getf *standard-views* :trimetric) :page-width (* 8 72) :page-length (* 7 72) :objects (list self (the basis-surface))))) #+nil (define-object test-trimmed-from-dropped (trimmed-surface) :computed-slots ((uv-inputs t) (holes (list (the hole))) (reverse-island? t) (reverse-holes? t)) :hidden-objects ((basis-surface :type 'planar-surface :p00 (make-point 0 0 0) :p01 (make-point 0 10 0) :p10 (make-point 10 0 0) :p11 (make-point 15 15 0)) (island :type 'dropped-curve :curve-in (the raised-island) :surface (the basis-surface)) (hole :type 'dropped-curve :curve-in (the raised-hole) :surface (the basis-surface)) (raised-hole :type 'b-spline-curve :control-points (list (make-point 3.5 4.5 10) (make-point 4.5 6 10) (make-point 5.5 7 10) (make-point 6 4.5 10) (make-point 5.5 2 10) (make-point 4.5 2 10) (make-point 3.5 4.5 10))) (raised-island :type 'b-spline-curve :control-points (list (make-point 3 5 1) (make-point 5 8 1) (make-point 7 10 1) (make-point 8 5 1) (make-point 7 0 1) (make-point 5 0 1) (make-point 3 5 1))))) #+nil (define-object test-trimmed-from-dropped-2 (trimmed-surface) :computed-slots ((uv-inputs t) (holes (list (the hole))) (reverse-island? t) (reverse-holes? t) (display-controls (list :color :blue :line-thickness 2))) :hidden-objects ((basis-surface :type 'test-fitted-surface :display-controls (list :color :grey-light-very) :length 10 :width 10 :height 5) (island :type 'dropped-curve :curve-in (the raised-island) :surface (the basis-surface)) (hole :type 'dropped-curve :curve-in (the raised-hole) :surface (the basis-surface)) (raised-hole :type 'b-spline-curve :display-controls (list :color :grey-light-very) :control-points (list (make-point 3.5 4.5 7) (make-point 4.5 6 7) (make-point 5.5 7 7) (make-point 6 4.5 7) (make-point 5.5 2 7) (make-point 4.5 2 7) (make-point 3.5 4.5 7))) (raised-island :type 'b-spline-curve :display-controls (list :color :grey-light-very) :control-points (list (make-point 3 5 7) (make-point 5 8 7) (make-point 7 10 7) (make-point 8 5 7) (make-point 7 0 7) (make-point 5 0 7) (make-point 3 5 7))) (view :type 'base-view :projection-vector (getf *standard-views* :trimetric) :page-width (* 8 72) :page-length (* 7 72) :objects (list self (the raised-hole) (the raised-island) (the basis-surface))))) #+nil (define-object test-trimmed-from-projected (trimmed-surface) :computed-slots ((uv-inputs t) (island (the island-3d uv-curve)) (holes (list (the hole uv-curve)))) :hidden-objects ((basis-surface :type 'planar-surface :p00 (make-point 0 0 0) :p01 (make-point 0 10 0) :p10 (make-point 10 0 0) :p11 (make-point 15 15 0)) (island-3d :type 'projected-curve :curve-in (the raised-island) :surface (the basis-surface) :projection-vector (make-vector 0 0 -1)) (hole :type 'projected-curve :curve-in (the raised-hole) :surface (the basis-surface) :projection-vector (make-vector 0 0 -1)) (raised-hole :type 'b-spline-curve :control-points (list (make-point 3.5 4.5 10) (make-point 4.5 6 10) (make-point 5.5 7 10) (make-point 6 4.5 10) (make-point 5.5 2 10) (make-point 4.5 2 10) (make-point 3.5 4.5 10))) (raised-island :type 'b-spline-curve :control-points (list (make-point 3 5 1) (make-point 5 8 1) (make-point 7 10 1) (make-point 8 5 1) (make-point 7 0 1) (make-point 5 0 1) (make-point 3 5 1))))) #+nil (define-object test-trimmed-from-projected-2 (trimmed-surface) :computed-slots ((uv-inputs t) (island (the island-3d uv-curve)) (holes (list (the hole uv-curve))) (display-controls (list :color :blue :line-thickness 2))) :objects ((basis-surface :type 'test-fitted-surface :display-controls (list :color :pink) :grid-length 10 :grid-width 10 :grid-height 5 ) (raised-hole :type 'b-spline-curve :display-controls (list :color :grey-light-very) :control-points (list (make-point 3.5 4.5 7) (make-point 4.5 6 7) (make-point 5.5 7 7) (make-point 6 4.5 7) (make-point 5.5 2 7) (make-point 4.5 2 7) (make-point 3.5 4.5 7))) (raised-island :type 'b-spline-curve :display-controls (list :color :grey-light-very) :control-points (list (make-point 3 5 7) (make-point 5 8 7) (make-point 7 10 7) (make-point 8 5 7) (make-point 7 0 7) (make-point 5 0 7) (make-point 3 5 7)))) :hidden-objects ((island-3d :type 'projected-curve :curve-in (the raised-island) :surface (the basis-surface) :projection-vector (make-vector 0 0 -1)) (hole :type 'projected-curve :curve-in (the raised-hole) :surface (the basis-surface) :projection-vector (make-vector 0 0 -1)))) #+nil (define-object test-trimmed-from-projected-3 (trimmed-surface) :computed-slots ((uv-inputs t) (island (reverse (list-elements (the island-curves))))) :hidden-objects ((basis-surface :type 'planar-surface :p00 (make-point 0 0 0) :p01 (make-point 0 10 0) :p10 (make-point 10 0 0) :p11 (make-point 10 10 0)) (island-curves :type 'projected-curve :sequence (:size (length (the-child ordered-curves))) :ordered-curves (the raised-island ordered-curves) :curve-in (nth (the-child index) (the-child ordered-curves)) :surface (the basis-surface) :projection-vector (make-vector 0 0 1)) (raised-island :type 'global-filleted-polyline-curves :default-radius 0.5 :vertex-list (list (make-point 1 1 -1) (make-point 9 1 -1) (make-point 9 9 -1) (make-point 1 9 -1) (make-point 1 1 -1)) #+nil (list (the basis-surface p00) (the basis-surface p01) (the basis-surface p11) (the basis-surface p10) (the basis-surface p00))))) #+nil (define-object basis-copy (b-spline-surface) :input-slots ("GDL Surface. Surface to provide the source basis data." built-from) :computed-slots ((b-spline-data (multiple-value-list (the built-from b-spline-data))) (control-points (first (the b-spline-data))) (weights (second (the b-spline-data))) (u-knot-vector (third (the b-spline-data))) (v-knot-vector (fourth (the b-spline-data))) (u-degree (fifth (the b-spline-data))) (v-degree (sixth (the b-spline-data)))))
18,776
Common Lisp
.lisp
385
30.768831
115
0.475663
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
8b721aaa9bc8d4082be87d96835631c921071eeaedfc4289b6c79e64d74141c6
35,652
[ -1 ]
35,653
native-reader.lisp
lisp-mirror_gendl/regression/source/native-reader.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package gdl-lift-tests) (define-object native-reader-test (native-reader) :computed-slots ((file-name (merge-pathnames "nurb_fillet.iwp" gdl-lift-utils::*lift-data-directory*)) (properties-tolerance (* 1.0e-3 (the (breps 0) max-extent))) (regression-test-data (append (multiple-value-list (the (breps 0) (precise-properties :tolerance (the properties-tolerance)))) (the (breps 0) %curves-to-draw%) (the (breps 0) %lines-to-draw%))))) (register-test-definition 'native-reader-test) (define-object native-reader-test-2 (native-reader) :computed-slots ((file-name (merge-pathnames "pegasus-subtracted.iwp" gdl-lift-utils::*lift-data-directory*)) (regression-test-data (the breps number-of-elements))))
1,670
Common Lisp
.lisp
35
43.457143
98
0.721566
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
5572c8657693c5ce87f4eec99155eae7719e6b32b4e84ce3651126ba17452cc6
35,653
[ -1 ]
35,654
transformed-surface.lisp
lisp-mirror_gendl/regression/source/transformed-surface.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object transformed-surface-test (transformed-surface) :computed-slots ((surface-in (the surface)) (to-location (make-point 10 0 0)) (to-orientation nil) (scale 2.0) (points-data '(((0 0 0)(4 1 0)(8 1 0)(10 0 0)(8 -1 0)(4 -1 0)(0 0 0)) ((0 0 2) (4 2 2) (8 2 2) (10 0 2) (8 -2 2) (4 -2 2) (0 0 2)) ((0 0 4) (4 2 4) (8 2 4) (10 0 4) (8 -2 4) (4 -2 4) (0 0 4)) ((0 0 7) (4 1 7) (8 1 7) (10 0 7) (8 -1 7) (4 -1 7) (0 0 7)))) (regression-test-data (multiple-value-list (the b-spline-data)))) :objects ((surface :type 'b-spline-surface :control-points (mapcar #'(lambda(list) (mapcar #'apply-make-point list)) (the points-data))))) (define-object test-transformed-surface (transformed-surface) :input-slots ((surface-in (the trimmed surf))) :objects ((trimmed :type 'surf::test-trimmed-from-projected))) (register-test-definition 'transformed-surface-test)
1,871
Common Lisp
.lisp
41
41.439024
101
0.673913
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
b371414155ad2b210637e6be43d8b5274c6f8717b9fea45ec87a659feeb3ab7b
35,654
[ -1 ]
35,655
linear-curve.lisp
lisp-mirror_gendl/regression/source/linear-curve.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object linear-curve-test (linear-curve) :computed-slots ((start (make-point 0 0 0)) (end (make-point 10 10 0)) (regression-test-data (multiple-value-list (the b-spline-data))))) (register-test-definition 'linear-curve-test)
1,176
Common Lisp
.lisp
27
40.259259
71
0.735816
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
79b7275c5fa9323893195054f85bdd34cdcfb3ec60dfd53e4b52472434fbd8e7
35,655
[ -1 ]
35,656
intersected-solid.lisp
lisp-mirror_gendl/regression/source/intersected-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object intersected-solid-test (intersected-solid) :computed-slots ((brep (the cylinder)) (other-brep (the box)) (error-on-invalid? nil) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%) (multiple-value-list (the intersect precise-properties)) (the intersect %curves-to-draw%) (the intersect %lines-to-draw%)))) :objects ((cylinder :type 'cylinder-solid :radius 10 :length 20) (box :type 'box-solid :length 10 :height 10 :width 30) (plane :type 'planar-surface :p00 (make-point -15 0 -15) :p01 (make-point -15 0 15) :p10 (make-point 15 0 -15) :p11 (make-point 15 0 15)) (intersect :type 'intersected-solid :brep (the cylinder) :other-brep (the plane brep)))) (register-test-definition 'intersected-solid-test)
1,894
Common Lisp
.lisp
49
33.102041
82
0.682724
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
da541bc7d6c187c09f02a3be1b1b13986a13fced2ce9cd65eb52d119348fa021
35,656
[ -1 ]
35,657
cone-solid.lisp
lisp-mirror_gendl/regression/source/cone-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object cone-solid-test (cone-solid) :computed-slots ((length 100) (radius-1 10) (radius-2 20) (inner-radius-1 8) (inner-radius-2 16) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%))))) (register-test-definition 'cone-solid-test)
1,289
Common Lisp
.lisp
32
36.28125
81
0.716599
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
92d8b029c9124d76540f6ee49f271ca17487638b00fc0ca98b46ba0ac66e49e7
35,657
[ -1 ]
35,658
subtracted-solid.lisp
lisp-mirror_gendl/regression/source/subtracted-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object subtracted-solid-test (subtracted-solid) :computed-slots ((brep (the cylinder)) (other-brep (the box)) (regression-test-data (append (multiple-value-list (the precise-properties)) (the %curves-to-draw%) (the %lines-to-draw%)))) :objects ((cylinder :type 'cylinder-solid :radius 10 :length 20) (box :type 'box-solid :length 10 :height 10 :width 30))) (register-test-definition 'subtracted-solid-test)
1,431
Common Lisp
.lisp
37
34.054054
82
0.705409
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
0b60ca64a824d3d78b69132fd405a5b1a6cdaa96e540bb604548f3f9fa00b54c
35,658
[ -1 ]
35,659
surface-knot-reduction.lisp
lisp-mirror_gendl/regression/source/surface-knot-reduction.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object surface-knot-reduction-test (base-object) :input-slots ( #+nil (control-points (list (make-point 0 0.01 0) (make-point 2 3.0 0.0) (make-point 4 2.0 0.0) (make-point 5 0.0 0.0) (make-point 4 -2.0 0.0) (make-point 2 -3.0 0.0) (make-point 0 -0.01 0) (make-point 0 0.01 0) )) (control-points (list (make-point 0 0 0) (make-point 2 3.0 0.0) (make-point 4 2.0 0.0) (make-point 5 0.0 0.0) (make-point 4 -2.0 0.0) (make-point 2 -3.0 0.0) (make-point 0 0 0) )) ) :computed-slots ((regression-test-data (multiple-value-list (the S-knot-reduction b-spline-data)))) :objects ((curve-1 :type 'b-spline-curve :display-controls (list :line-thickness 2 :color :green-spring-medium) :control-points (the control-points)) (curve-2 :type 'boxed-curve :display-controls (list :line-thickness 2 :color :blue) :curve-in (the curve-1) :center (make-point 0 0 8)) (curve-3 :type 'transformed-curve :display-controls (list :line-thickness 2 :color :green) :curve-in (the curve-1) :to-location (translate (the center) :up 3) :center (the center) :scale-x 1.3 :scale-y 1.3) (curve-4 :type 'transformed-curve :display-controls (list :line-thickness 2 :color :red) :curve-in (the curve-1) :to-location (translate (the center) :up 7) :center (the center) :scale-x 2.2 :scale-y 2.2) (lofted-surface-test-simple :type 'lofted-surface ;;:display-controls (list :color :red-violet :isos (list :n-v 19 :n-u 19)) ;;:tolerance 1.0 :curves (list (the curve-2) (the curve-4) (the curve-3) (the curve-1) )) (S-knot-reduction :type 'surface-knot-reduction :surface (the lofted-surface-test-simple)))) (register-test-definition 'surface-knot-reduction-test)
2,856
Common Lisp
.lisp
82
29.646341
85
0.657404
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
59e53ab043f850ff89d9955f77c255bfbb68197005c3cbcc9d7c208a86bb98b8
35,659
[ -1 ]
35,660
transformed-curve.lisp
lisp-mirror_gendl/regression/source/transformed-curve.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object transformed-curve-test (transformed-curve) :computed-slots ((curve-in (the curve)) (to-location (make-point 10 0 0)) (to-orientation nil) (scale 2.0) (regression-test-data (multiple-value-list (the b-spline-data)))) :objects ((curve :type 'arc-curve :center (make-point 0 0 0) :radius 10 :start-angle 0 :end-angle 2pi))) (register-test-definition 'transformed-curve-test)
1,359
Common Lisp
.lisp
35
35.257143
71
0.723372
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
019591372357ca2d08eabc796708ea3451e42ad5d69f353f8ff583d46513b799
35,660
[ -1 ]
35,661
test-harness.lisp
lisp-mirror_gendl/regression/source/test-harness.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package gdl-lift-tests) (define-object test-harness (base-object) :input-slots ((hide-tests? t :settable)) :objects ((curves :type 'curve-tests :hide-tests? (the hide-tests?)) (surfaces :type 'surface-tests :hide-tests? (the hide-tests?)) (solids :type 'solid-tests :hide-tests? (the hide-tests?)) (readers :type 'reader-tests :hide-tests? (the hide-tests?)) (writers :type 'writer-tests :hide-tests? (the hide-tests?)) (customer-parts :type 'customer-part-tests :hide-tests? (the hide-tests?)))) (define-object curve-tests (base-object) :input-slots ((hide-tests? t :settable)) :computed-slots ((arc-curve-test-result (gdl-lift-utils::test-object (the arc-curve-test))) (b-spline-curve-test-result (gdl-lift-utils::test-object (the b-spline-curve-test))) (boxed-curve-test-result (gdl-lift-utils::test-object (the boxed-curve-test))) (brep-intersect-test-result (gdl-lift-utils::test-object (the brep-intersect-test))) (compatible-curves-test-result (gdl-lift-utils::test-object (the compatible-curves-test))) (composed-curve-test-result (gdl-lift-utils::test-object (the composed-curve-test))) (composed-curves-test-result (gdl-lift-utils::test-object (the composed-curves-test))) (decomposed-curves-test-result (gdl-lift-utils::test-object (the decomposed-curves-test))) (dropped-curve-test-result (gdl-lift-utils::test-object (the dropped-curve-test))) (elliptical-curve-test-result (gdl-lift-utils::test-object (the elliptical-curve-test))) (fitted-curve-test-result (gdl-lift-utils::test-object (the fitted-curve-test))) (fitted-curve-test-2-result (gdl-lift-utils::test-object (the fitted-curve-test-2))) (fitted-curve-test-3-result (gdl-lift-utils::test-object (the fitted-curve-test-3))) (global-filleted-polyline-curves-test-result (gdl-lift-utils::test-object (the global-filleted-polyline-curves-test))) (iso-curve-test-result (gdl-lift-utils::test-object (the iso-curve-test))) (linear-curve-test-result (gdl-lift-utils::test-object (the linear-curve-test))) (planar-offset-curve-test-result (gdl-lift-utils::test-object (the planar-offset-curve-test))) (planar-section-curve-test-result (gdl-lift-utils::test-object (the planar-section-curve-test))) (planar-section-curves-test-result (gdl-lift-utils::test-object (the planar-section-curves-test))) (planar-section-curves-test-2-result (gdl-lift-utils::test-object (the planar-section-curves-test-2))) (projected-curve-test-result (gdl-lift-utils::test-object (the projected-curve-test))) (reparameterized-curve-test-result (gdl-lift-utils::test-object (the reparameterized-curve-test))) (transformed-curve-test-result (gdl-lift-utils::test-object (the transformed-curve-test))) (trimmed-curve-test-result (gdl-lift-utils::test-object (the trimmed-curve-test))) (all-curve-tests (mapcar #'gdl-lift-utils::test-object (the objects))) (all-curve-tests-passed (every #'(lambda (test) (equal test t)) (the all-curve-tests))) (objects (mapcar #'(lambda (part-keyword) (the (evaluate part-keyword))) (the %object-keywords%)))) :objects ((arc-curve-test :type 'gdl-lift-tests::arc-curve-test :hidden? (the hide-tests?)) (b-spline-curve-test :type 'gdl-lift-tests::b-spline-curve-test :hidden? (the hide-tests?)) (boxed-curve-test :type 'gdl-lift-tests::boxed-curve-test :hidden? (the hide-tests?)) (brep-intersect-test :type 'gdl-lift-tests::brep-intersect-test :hidden? (the hide-tests?)) (compatible-curves-test :type 'gdl-lift-tests::compatible-curves-test :hidden? (the hide-tests?)) (composed-curve-test :type 'gdl-lift-tests::composed-curve-test :hidden? (the hide-tests?)) (composed-curves-test :type 'gdl-lift-tests::composed-curves-test :hidden? (the hide-tests?)) (decomposed-curves-test :type 'gdl-lift-tests::decomposed-curves-test :hidden? (the hide-tests?)) (dropped-curve-test :type 'gdl-lift-tests::dropped-curve-test :hidden? (the hide-tests?)) (elliptical-curve-test :type 'gdl-lift-tests::elliptical-curve-test :hidden? (the hide-tests?)) (fitted-curve-test :type 'gdl-lift-tests::fitted-curve-test :hidden? (the hide-tests?)) (fitted-curve-test-2 :type 'gdl-lift-tests::fitted-curve-test-2 :hidden? (the hide-tests?)) (fitted-curve-test-3 :type 'gdl-lift-tests::fitted-curve-test-3 :hidden? (the hide-tests?)) (global-filleted-polyline-curves-test :type 'gdl-lift-tests::global-filleted-polyline-curves-test :hidden? (the hide-tests?)) (iso-curve-test :type 'gdl-lift-tests::iso-curve-test :hidden? (the hide-tests?)) (linear-curve-test :type 'gdl-lift-tests::linear-curve-test :hidden? (the hide-tests?)) (planar-offset-curve-test :type 'gdl-lift-tests::planar-offset-curve-test :hidden? (the hide-tests?)) (planar-section-curve-test :type 'gdl-lift-tests::planar-section-curve-test :hidden? (the hide-tests?)) (planar-section-curves-test :type 'gdl-lift-tests::planar-section-curves-test :hidden? (the hide-tests?)) (planar-section-curves-test-2 :type 'gdl-lift-tests::planar-section-curves-test-2 :hidden? (the hide-tests?)) (projected-curve-test :type 'gdl-lift-tests::projected-curve-test :hidden? (the hide-tests?)) (reparameterized-curve-test :type 'gdl-lift-tests::reparameterized-curve-test :hidden? (the hide-tests?)) (transformed-curve-test :type 'gdl-lift-tests::transformed-curve-test :hidden? (the hide-tests?)) (trimmed-curve-test :type 'gdl-lift-tests::trimmed-curve-test :hidden? (the hide-tests?)))) (define-object surface-tests (base-object) :input-slots ((hide-tests? t :settable)) :computed-slots ((b-spline-surface-test-result (gdl-lift-utils::test-object (the b-spline-surface-test))) (boxed-surface-test-result (gdl-lift-utils::test-object (the boxed-surface-test))) (compatible-surfaces-test-result (gdl-lift-utils::test-object (the compatible-surfaces-test))) (dual-blend-surface-test-result (gdl-lift-utils::test-object (the dual-blend-surface-test))) (edge-blend-surface-test-result (gdl-lift-utils::test-object (the edge-blend-surface-test))) (fitted-surface-test-result (gdl-lift-utils::test-object (the fitted-surface-test))) (fitted-surface-test-2-result (gdl-lift-utils::test-object (the fitted-surface-test-2))) (fitted-surface-test-3-result (gdl-lift-utils::test-object (the fitted-surface-test-3))) (general-dual-blend-surface-test-result (gdl-lift-utils::test-object (the general-dual-blend-surface-test))) (gdl-lift-tests::general-sweep-test-result (gdl-lift-utils::test-object (the general-sweep-test))) (gdl-lift-tests::joined-surfaces-test-result (gdl-lift-utils::test-object (the joined-surfaces-test))) (lofted-surface-test-result (gdl-lift-utils::test-object (the lofted-surface-test))) (lofted-surface-test-2-result (gdl-lift-utils::test-object (the lofted-surface-test-2))) (planar-contour-surface-test-result (gdl-lift-utils::test-object (the planar-contour-surface-test))) (planar-surface-test-result (gdl-lift-utils::test-object (the planar-surface-test))) (rectangular-surface-test-result (gdl-lift-utils::test-object (the rectangular-surface-test))) (revolved-surface-test-result (gdl-lift-utils::test-object (the revolved-surface-test))) (revolved-surfaces-test-result (gdl-lift-utils::test-object (the revolved-surfaces-test))) (ruled-surface-test-result (gdl-lift-utils::test-object (the ruled-surface-test))) (spherical-surface-test-result (gdl-lift-utils::test-object (the spherical-surface-test))) (transformed-surface-test-result (gdl-lift-utils::test-object (the transformed-surface-test))) (trimmed-surface-test-result (gdl-lift-utils::test-object (the trimmed-surface-test))) (all-surface-tests (mapcar #'gdl-lift-utils::test-object (the objects))) (all-surface-tests-passed (every #'(lambda (test) (equal test t)) (the all-surface-tests))) (objects (mapcar #'(lambda (part-keyword) (the (evaluate part-keyword))) (the %object-keywords%)))) :objects ((b-spline-surface-test :type 'gdl-lift-tests::b-spline-surface-test :hidden? (the hide-tests?)) (boxed-surface-test :type 'gdl-lift-tests::boxed-surface-test :hidden? (the hide-tests?)) (compatible-surfaces-test :type 'gdl-lift-tests::compatible-surfaces-test :hidden? (the hide-tests?)) (dual-blend-surface-test :type 'gdl-lift-tests::dual-blend-surface-test :hidden? (the hide-tests?)) (edge-blend-surface-test :type 'gdl-lift-tests::edge-blend-surface-test :hidden? (the hide-tests?)) (fitted-surface-test :type 'gdl-lift-tests::fitted-surface-test :hidden? (the hide-tests?)) (fitted-surface-test-2 :type 'gdl-lift-tests::fitted-surface-test-2 :hidden? (the hide-tests?)) (fitted-surface-test-3 :type 'gdl-lift-tests::fitted-surface-test-3 :hidden? (the hide-tests?)) (general-dual-blend-surface-test :type 'gdl-lift-tests::general-dual-blend-surface-test :hidden? (the hide-tests?)) (gdl-lift-tests::general-sweep-test :type 'gdl-lift-tests::general-sweep-test :hidden? (the hide-tests?)) (gdl-lift-tests::joined-surfaces-test :type 'gdl-lift-tests::joined-surfaces-test :hidden? (the hide-tests?)) (lofted-surface-test :type 'gdl-lift-tests::lofted-surface-test :hidden? (the hide-tests?)) (lofted-surface-test-2 :type 'gdl-lift-tests::lofted-surface-test-2 :hidden? (the hide-tests?)) (planar-contour-surface-test :type 'gdl-lift-tests::planar-contour-surface-test :hidden? (the hide-tests?)) (planar-surface-test :type 'gdl-lift-tests::planar-surface-test :hidden? (the hide-tests?)) (rectangular-surface-test :type 'gdl-lift-tests::rectangular-surface-test :hidden? (the hide-tests?)) (revolved-surface-test :type 'gdl-lift-tests::revolved-surface-test :hidden? (the hide-tests?)) (revolved-surfaces-test :type 'gdl-lift-tests::revolved-surfaces-test :hidden? (the hide-tests?)) (ruled-surface-test :type 'gdl-lift-tests::ruled-surface-test :hidden? (the hide-tests?)) (spherical-surface-test :type 'gdl-lift-tests::spherical-surface-test :hidden? (the hide-tests?)) (transformed-surface-test :type 'gdl-lift-tests::transformed-surface-test :hidden? (the hide-tests?)) (trimmed-surface-test :type 'gdl-lift-tests::trimmed-surface-test :hidden? (the hide-tests?)))) (define-object solid-tests (base-object) :input-slots ((hide-tests? t :settable)) :computed-slots ((blended-solid-test-result (gdl-lift-utils::test-object (the blended-solid-test))) (boolean-test-result (gdl-lift-utils::test-object (the boolean-test))) (box-solid-test-result (gdl-lift-utils::test-object (the box-solid-test))) (cone-solid-test-result (gdl-lift-utils::test-object (the cone-solid-test))) (cylinder-solid-test-result (gdl-lift-utils::test-object (the cylinder-solid-test))) (extruded-solid-test-result (gdl-lift-utils::test-object (the extruded-solid-test))) (intersected-solid-test-result (gdl-lift-utils::test-object (the intersected-solid-test))) (merged-solid-test-result (gdl-lift-utils::test-object (the merged-solid-test))) (poly-brep-test-result (gdl-lift-utils::test-object (the poly-brep-test))) (regioned-solid-test-result (gdl-lift-utils::test-object (the regioned-solid-test))) (separated-solid-test-result (gdl-lift-utils::test-object (the separated-solid-test))) (sewn-solid-test-result (gdl-lift-utils::test-object (the sewn-solid-test))) (subtracted-solid-test-result (gdl-lift-utils::test-object (the subtracted-solid-test))) (swept-solid-test-result (gdl-lift-utils::test-object (the swept-solid-test))) (transformed-solid-test-result (gdl-lift-utils::test-object (the transformed-solid-test))) (united-solid-test-result (gdl-lift-utils::test-object (the united-solid-test))) (all-solid-tests (mapcar #'gdl-lift-utils::test-object (the objects))) (all-solid-tests-passed (every #'(lambda (test) (equal test t)) (the all-solid-tests))) (objects (mapcar #'(lambda (part-keyword) (the (evaluate part-keyword))) (the %object-keywords%)))) :objects ((blended-solid-test :type 'gdl-lift-tests::blended-solid-test :hidden? (the :hide-tests?)) (boolean-test :type 'gdl-lift-tests::boolean-test :hidden? (the :hide-tests?)) (box-solid-test :type 'gdl-lift-tests::box-solid-test :hidden? (the :hide-tests?)) (cone-solid-test :type 'gdl-lift-tests::cone-solid-test :hidden? (the :hide-tests?)) (cylinder-solid-test :type 'gdl-lift-tests::cylinder-solid-test :hidden? (the :hide-tests?)) (extruded-solid-test :type 'gdl-lift-tests::extruded-solid-test :hidden? (the :hide-tests?)) (intersected-solid-test :type 'gdl-lift-tests::intersected-solid-test :hidden? (the :hide-tests?)) (merged-solid-test :type 'gdl-lift-tests::merged-solid-test :hidden? (the :hide-tests?)) (poly-brep-test :type 'gdl-lift-tests::poly-brep-test :hidden? (the :hide-tests?)) (regioned-solid-test :type 'gdl-lift-tests::regioned-solid-test :hidden? (the :hide-tests?)) (separated-solid-test :type 'gdl-lift-tests::separated-solid-test :hidden? (the :hide-tests?)) (sewn-solid-test :type 'gdl-lift-tests::sewn-solid-test :hidden? (the :hide-tests?)) (subtracted-solid-test :type 'gdl-lift-tests::subtracted-solid-test :hidden? (the :hide-tests?)) (swept-solid-test :type 'gdl-lift-tests::swept-solid-test :hidden? (the :hide-tests?)) (transformed-solid-test :type 'gdl-lift-tests::transformed-solid-test :hidden? (the :hide-tests?)) (united-solid-test :type 'gdl-lift-tests::united-solid-test :hidden? (the :hide-tests?)))) (define-object reader-tests (base-object) :input-slots ((hide-tests? t :settable)) :computed-slots ((iges-reader-test-result (gdl-lift-utils::test-object (the iges-reader-test))) (native-reader-test-result (gdl-lift-utils::test-object (the native-reader-test))) (step-reader-test-result (gdl-lift-utils::test-object (the step-reader-test))) (all-reader-tests (mapcar #'gdl-lift-utils::test-object (the objects))) (all-reader-tests-passed (every #'(lambda (test) (equal test t)) (the all-reader-tests))) (objects (mapcar #'(lambda (part-keyword) (the (evaluate part-keyword))) (the %object-keywords%)))) :objects ((iges-reader-test :type 'gdl-lift-tests::iges-reader-test :hidden? (the :hide-tests?)) (native-reader-test :type 'gdl-lift-tests::native-reader-test :hidden? (the :hide-tests?)) (step-reader-test :type 'gdl-lift-tests::step-reader-test :hidden? (the :hide-tests?)))) (define-object writer-tests (base-object) :input-slots ((hide-tests? t :settable)) :computed-slots ((iges-writer-test-result (gdl-lift-utils::test-object (the iges-writer-test))) (step-writer-test-result (gdl-lift-utils::test-object (the step-writer-test))) (all-writer-tests (mapcar #'gdl-lift-utils::test-object (the objects))) (all-writer-tests-passed (every #'(lambda (test) (equal test t)) (the all-writer-tests))) (objects (mapcar #'(lambda (part-keyword) (the (evaluate part-keyword))) (the %object-keywords%)))) :objects ((iges-writer-test :type 'gdl-lift-tests::iges-writer-test :hidden? (the :hide-tests?)) (step-writer-test :type 'gdl-lift-tests::step-writer-test :hidden? (the :hide-tests?)))) (define-object customer-part-tests (base-object) :input-slots ((hide-tests? t :settable)) :computed-slots ((pegasus-regioned-solid-test-result (gdl-lift-utils::test-object (the pegasus-regioned-solid-test))) (wing-assembly-test-result (gdl-lift-utils::test-object (the wing-assembly-test))) (all-customer-part-tests (mapcar #'gdl-lift-utils::test-object (the objects))) (all-customer-part-tests-passed (every #'(lambda (test) (equal test t)) (the all-customer-part-tests))) (objects (mapcar #'(lambda (part-keyword) (the (evaluate part-keyword))) (the %object-keywords%)))) :objects ((pegasus-regioned-solid-test :type 'gdl-lift-tests::pegasus-regioned-solid-test :hidden? (the :hide-tests?)) (wing-assembly-test :type 'gdl-lift-tests::wing-assembly-test :hidden? (the :hide-tests?)))) (define-object tasty-test-harness (tasty:assembly) :computed-slots ((root-object-type 'test-harness))) (gwl:publish-gwl-app "/test-harness" "gdl-user::tasty-test-harness")
17,074
Common Lisp
.lisp
233
69.330472
128
0.726811
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
16f35304ff133974a978717292989446e439e6c1139029f4215f141756b3eb36
35,661
[ -1 ]
35,662
boxed-curve.lisp
lisp-mirror_gendl/regression/source/boxed-curve.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package gdl-lift-tests) (define-object boxed-curve-test (base-object) :computed-slots ((control-points (list (make-point 0 0 0) (make-point 2 3.0 0.0) (make-point 4 2.0 0.0) (make-point 5 0.0 0.0) (make-point 4 -2.0 0.0) (make-point 2 -3.0 0.0) (make-point 0 0 0))) (regression-test-data (mapcar #'(lambda(curve) (multiple-value-list (the-object curve b-spline-data))) (rest (the children))))) :objects ((b-spline :type 'b-spline-curve :control-points (the control-points)) (boxed :type 'boxed-curve :curve-in (the b-spline)) (translated :type 'boxed-curve :curve-in (the b-spline) :center (translate (the center) :left 15)) (twisted :type 'boxed-curve :curve-in (the boxed) :orientation (alignment :left (the (face-normal-vector :top)) :rear (rotate-vector-d (the (face-normal-vector :rear)) 30 (the (face-normal-vector :top))))) (rotated :type 'boxed-curve :curve-in (the b-spline) :display-controls (list :color :purple) :orientation (alignment :left (rotate-vector-d (the (face-normal-vector :left)) 50 (the (face-normal-vector :rear))))) (rotated-about :type 'boxed-curve :curve-in (the b-spline) :display-controls (list :color :purple) :orientation-center (translate (the center) :right 2.5) :orientation (alignment :left (rotate-vector-d (the (face-normal-vector :left)) 45 (the (face-normal-vector :rear))))) (moved-up :type 'boxed-curve :curve-in (the rotated-about) :center (translate (the rotated-about center) :up 7 :left 5)) (straightened :type 'boxed-curve :curve-in (the moved-up) :orientation (alignment :left (rotate-vector-d (the-child curve-in (face-normal-vector :left)) 45 (the-child curve-in (face-normal-vector :rear))) :rear (the-child curve-in (face-normal-vector :rear)))) (rotated-straightened :type 'boxed-curve :curve-in (the straightened) :orientation (the moved-up orientation) :orientation-center (translate (the-child curve-in center) :up 2.5)) (rotated-straightened-moved :type 'boxed-curve :curve-in (the rotated-straightened) :center (translate (the-child curve-in center) :right 5)) (moved-up-and-straightened :type 'boxed-curve :curve-in (the straightened) :center (translate (the-child orientation-center) :right 7) :orientation (alignment :left (the-child curve-in (face-normal-vector :rear)) :front (rotate-vector-d (the-child curve-in (face-normal-vector :left)) 45 (the-child curve-in (face-normal-vector :rear)))) :orientation-center (translate (the straightened center) :up 2.5)) (moved-up-and-straightened-1 :type 'boxed-curve :curve-in (the straightened) :center (translate (the-child curve-in center) :right 14) :orientation (the rotated-straightened orientation) :orientation-center (translate (the straightened center) :up 2.5)) (moved-up-and-straightened-2 :type 'boxed-curve :curve-in (the straightened) :center (translate (the-child curve-in center) :right 21) :orientation (the rotated-straightened orientation) :orientation-center (translate (the straightened center) :up 2.5)) (transformed :type 'boxed-curve :curve-in (the b-spline) :center (translate (the center) :left 50) :orientation (alignment :rear (rotate-vector-d (the (face-normal-vector :rear)) 30 (the (face-normal-vector :right))))))) (register-test-definition 'boxed-curve-test)
4,754
Common Lisp
.lisp
110
35.872727
76
0.659251
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
9cceb23da44a25771cfd4967e550eaa302df9a7f04a816120af43284864fdbf0
35,662
[ -1 ]
35,663
global-filleted-polyline-curves.lisp
lisp-mirror_gendl/regression/source/global-filleted-polyline-curves.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object global-filleted-polyline-curves-test (global-filleted-polyline-curves) :computed-slots ((default-radius 5) (vertex-list (list (make-point 0 0 0) (make-point 10 10 0) (make-point 30 10 0) (make-point 40 0 0) (make-point 30 -10 0) (make-point 10 -10 0) (make-point 0 0 0))) (regression-test-data (list (mapcar #'(lambda (curve) (multiple-value-list (the-object curve b-spline-data))) (the ordered-curves)))))) (register-test-definition 'global-filleted-polyline-curves-test) (define-object global-filleted-polyline-curve-test (global-filleted-polyline-curve) :computed-slots ((default-radius 5) (vertex-list (list (make-point 0 0 0) (make-point 10 10 0) (make-point 30 10 0) (make-point 40 0 0) (make-point 30 -10 0) (make-point 10 -10 0) (make-point 0 0 0))) (regression-test-data (mapcar #'(lambda (curve) (multiple-value-list (the-object curve b-spline-data))) (the ordered-curves))))) (register-test-definition 'global-filleted-polyline-curve-test) (define-object global-filleted-polyline-curve-open-test (global-filleted-polyline-curve) :computed-slots ((default-radius 5) (vertex-list (list (make-point 0 0 0) (make-point 10 10 0) (make-point 30 10 0) (make-point 40 0 0) (make-point 60 0 0) (make-point 70 10 0) )) (regression-test-data (multiple-value-list (the b-spline-data)))))
2,514
Common Lisp
.lisp
60
35.4
89
0.672234
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
bc19fe775b5d2e695d99db1d6722b0798c9201d7e92c3463697e76736b471bc8
35,663
[ -1 ]
35,664
separated-solid.lisp
lisp-mirror_gendl/regression/source/separated-solid.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object separated-solid-test (base-object) :computed-slots ((regression-test-data (mapcar #'(lambda(brep) (append (multiple-value-list (the-object brep precise-properties)) (the-object brep %curves-to-draw%) (the-object brep %lines-to-draw%))) (list-elements (the separated breps))))) :objects ((cylinder :type 'cylinder-solid :radius 10 :length 20) (plane :type 'planar-surface :p00 (make-point -15 0 -15) :p01 (make-point -15 0 15) :p10 (make-point 15 0 -15) :p11 (make-point 15 0 15)) (separated-2 :type 'surf::separated-solid-2 :brep (the cylinder) :other-brep (the plane) :approximation-tolerance (* 0.001 (the-child brep adaptive-tolerance))) (separated :type 'separated-solid :brep (the cylinder) :other-brep (the plane) :approximation-tolerance (* 0.001 (the-child brep adaptive-tolerance)) ;;:cap-results? t ))) (register-test-definition 'separated-solid-test)
1,991
Common Lisp
.lisp
48
35.645833
78
0.686016
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
0778c227b843821defdcea70784156051ae589552be3962ca25ee2c4b52bb06f
35,664
[ -1 ]
35,665
edge-blend-surface.lisp
lisp-mirror_gendl/regression/source/edge-blend-surface.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object edge-blend-surface-test (edge-blend-surface) :computed-slots ((curve-side-1 :left-side) (curve-side-2 :left-side) (regression-test-data (multiple-value-list (the b-spline-data))) (curve-1-uv (the curve-1 uv-curve)) (curve-2-uv (the curve-2 uv-curve)) ) :objects ((surf-1-top :type 'linear-curve :hidden? t :start (make-point -5 -5 0) :end (make-point 5 -5 0)) (surf-1-bottom :type 'linear-curve :hidden? t :start (make-point -7 -10 -2) :end (make-point 7 -10 -2)) (surface-1 :type 'ruled-surface :curve-1 (the surf-1-top) :curve-2 (the surf-1-bottom)) (curve-1 :type 'iso-curve :surface (the surface-1) :parameter 0 :u-or-v :v) (surf-2-bottom :type 'linear-curve :hidden? t :start (make-point -5 5 0) :end (make-point 5 5 0)) (surf-2-top :type 'linear-curve :hidden? t :start (make-point -7 10 2) :end (make-point 7 10 2)) (surface-2 :type 'ruled-surface :curve-1 (the surf-2-bottom) :curve-2 (the surf-2-top)) (curve-2 :type 'iso-curve :surface (the surface-2) :parameter 0 :u-or-v :v))) (register-test-definition 'edge-blend-surface-test)
2,252
Common Lisp
.lisp
61
30.770492
71
0.654064
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
288477f280bc24015beac212e1d308246662ba8f3fed4b3613329ec7c6a48366
35,665
[ -1 ]
35,666
trimmed-curve.lisp
lisp-mirror_gendl/regression/source/trimmed-curve.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object trimmed-curve-test (trimmed-curve) :computed-slots ((built-from (the b-spline-curve)) (u1 0.2) (u2 0.8) (regression-test-data (multiple-value-list (the b-spline-data)))) :objects ((b-spline-curve :type 'b-spline-curve :control-points (list (make-point 0 0 0) (make-point 2 3.0 0.0) (make-point 4 2.0 0.0) (make-point 5 0.0 0.0) (make-point 4 -2.0 0.0) (make-point 2 -3.0 0.0) (make-point 0 0 0))))) (register-test-definition 'trimmed-curve-test)
1,482
Common Lisp
.lisp
37
35.297297
71
0.686096
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
894927e5dd254e5253a155b0c8d44ea80143282dd043a8ee5e32d02955ce609a
35,666
[ -1 ]
35,667
poly-brep.lisp
lisp-mirror_gendl/regression/source/poly-brep.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package gdl-lift-tests) (define-object poly-brep-test (surf::poly-brep) :computed-slots (;(chord-height-tolerance 0.0) ;(curve-tess-angle 10) ;(surface-tess-angle 10) ;(max-3d-edge 0.0) ;(max-aspect 0) (smooth-results? nil) (min-number-of-segments *tess-min-number-of-segments*) (max-3d-edge (* *tess-max-3d-edge-factor* (the brep max-extent))) (min-parametric-ratio *tess-min-parametric-ratio*) (max-chord-height *tess-max-chord-height*) (max-angle-degrees *tess-max-angle-degrees*) (min-3d-edge *tess-min-3d-edge*) (min-edge-ratio-uv *tess-min-edge-ratio-uv*) (max-aspect-ratio *tess-max-aspect-ratio*) (regression-test-data (the %lines-to-draw%))) :objects ((brep :type 'intersected-solid :brep (the cylinder) :other-brep (the box)) (cylinder :type 'cylinder-solid :radius 10 :length 20) (box :type 'box-solid :length 10 :height 10 :width 30))) (warn "Not registering poly-brep-test, has major memory leak and we think it's not being used except maybe by whitebox...") ;;(register-test-definition 'poly-brep-test)
2,080
Common Lisp
.lisp
52
35.038462
95
0.690536
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
8046e8ca64acfcf8c6fa1eec4acbf3bd9e0bd3c1aa88f62bfe25c77c449071f4
35,667
[ -1 ]
35,668
conic-curve.lisp
lisp-mirror_gendl/regression/source/conic-curve.lisp
;; ;; Copyright 2014 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object conic-curve-test (conic-curve) :computed-slots ((start-point (make-point -10 0 0)) (start-tangent (make-point 0.1 1 0)) (end-point (make-point 10 0 0)) (end-tangent (make-point -0.1 1 0)) (point-on-curve (make-point 0 12 0)) (regression-test-data (list (multiple-value-list (the b-spline-data)) (the %curves-to-draw%) )))) (register-test-definition 'conic-curve-test)
1,355
Common Lisp
.lisp
32
38.34375
75
0.70827
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
41a4315587524dee5eddc2cd5e5292f152bfda35987cd77bc73dc7d0795cdb9f
35,668
[ -1 ]
35,669
decomposed-curves.lisp
lisp-mirror_gendl/regression/source/decomposed-curves.lisp
;; ;; Copyright 2002, 2009 Genworks International and Genworks BV ;; ;; This source file is part of the General-purpose Declarative ;; Language project (GDL). ;; ;; This source file contains free software: you can redistribute it ;; and/or modify it under the terms of the GNU Affero General Public ;; License as published by the Free Software Foundation, either ;; version 3 of the License, or (at your option) any later version. ;; ;; This source file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; Affero General Public License for more details. ;; ;; You should have received a copy of the GNU Affero General Public ;; License along with this source file. If not, see ;; <http://www.gnu.org/licenses/>. ;; (in-package :gdl-lift-tests) (define-object decomposed-curves-test (decomposed-curves) :computed-slots ((curve-in (the composed-curve)) (regression-test-data (append-elements (the curves) (multiple-value-list (the-element b-spline-data))))) :objects ((composed-curve :type 'composed-curve :curves (the filleted-polyline-curves ordered-curves)) (filleted-polyline-curves :type 'global-filleted-polyline-curves :default-radius 5 :vertex-list (list (make-point 0 0 0) (make-point 10 10 0) (make-point 30 10 0) (make-point 40 0 0) (make-point 30 -10 0) (make-point 10 -10 0) (make-point 0 0 0))))) (register-test-definition 'decomposed-curves-test)
1,641
Common Lisp
.lisp
38
38.421053
108
0.712015
lisp-mirror/gendl
0
0
0
AGPL-3.0
9/19/2024, 11:44:17 AM (Europe/Amsterdam)
563a8cd5da18f3fbbf84a0aa360c101980f6aef652fe5243627d4882c1a39ac9
35,669
[ -1 ]