/usr/share/axiom-20170501/src/algebra/MESH.spad is in axiom-source 20170501-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | )abbrev package MESH MeshCreationRoutinesForThreeDimensions
++ Author: Jim Wen
++ Date Last Updated: October 1991 by Jon Steinbach
++ Description:
++ This package has no description
MeshCreationRoutinesForThreeDimensions() : SIG == CODE where
I ==> Integer
PI ==> PositiveInteger
SF ==> DoubleFloat
L ==> List
SEG ==> Segment
S ==> String
Fn1 ==> SF -> SF
Fn2 ==> (SF,SF) -> SF
Fn3 ==> (SF,SF,SF) -> SF
FnPt ==> (SF,SF) -> Point(SF)
FnU ==> Union(Fn3,"undefined")
EX ==> Expression
DROP ==> DrawOption
POINT ==> Point(SF)
SPACE3 ==> ThreeSpace(SF)
COMPPROP ==> SubSpaceComponentProperty
TUBE ==> TubePlot
SIG ==> with
meshPar2Var : (Fn2,Fn2,Fn2,FnU,SEG SF,SEG SF,L DROP) -> SPACE3
++ meshPar2Var(f,g,h,j,s1,s2,l) \undocumented
meshPar2Var : (FnPt,SEG SF,SEG SF,L DROP) -> SPACE3
++ meshPar2Var(f,s1,s2,l) \undocumented
meshPar2Var : (SPACE3,FnPt,SEG SF,SEG SF,L DROP) -> SPACE3
++ meshPar2Var(sp,f,s1,s2,l) \undocumented
meshFun2Var : (Fn2,FnU,SEG SF,SEG SF,L DROP) -> SPACE3
++ meshFun2Var(f,g,s1,s2,l) \undocumented
meshPar1Var : (EX I,EX I,EX I,Fn1,SEG SF,L DROP) -> SPACE3
++ meshPar1Var(s,t,u,f,s1,l) \undocumented
ptFunc : (Fn2,Fn2,Fn2,Fn3) -> ((SF,SF) -> POINT)
++ ptFunc(a,b,c,d) is an internal function exported in
++ order to compile packages.
CODE ==> add
import ViewDefaultsPackage()
import SubSpaceComponentProperty()
import DrawOptionFunctions0
import SPACE3
-- local functions
numberCheck(nums:Point SF):Void ==
-- this function checks to see that the small floats are
-- actually just that - rather than complex numbers or
-- whatever (the whatever includes nothing presently
-- since NaN, Not a Number, is not necessarily supported
-- by common lisp). note that this function is dependent
-- upon the fact that Common Lisp supports complex numbers.
for i in minIndex(nums)..maxIndex(nums) repeat
COMPLEXP(nums.(i::PositiveInteger))$Lisp =>
error _
"An unexpected complex number was encountered in the calculations."
makePt:(SF,SF,SF,SF) -> POINT
makePt(x,y,z,c) == point(l : List SF := [x,y,z,c])
ptFunc(f,g,h,c) ==
(z1:SF,z2:SF):POINT +->
x := f(z1,z2); y := g(z1,z2); z := h(z1,z2)
makePt(x,y,z,c(x,y,z))
-- parameterized equations of two variables
meshPar2Var(sp,ptFun,uSeg,vSeg,opts) ==
-- the issue of open and closed needs to be addressed, here, we are
-- defaulting to open (which is probably the correct default)
-- the user should be able to override that (optional argument?)
llp : L L POINT := nil()
uNum : PI := var1Steps(opts,var1StepsDefault())
vNum : PI := var2Steps(opts,var2StepsDefault())
ustep := (lo uSeg - hi uSeg)/uNum
vstep := (lo vSeg - hi vSeg)/vNum
someV := hi vSeg
for iv in vNum..0 by -1 repeat
if zero? iv then someV := lo vSeg
-- hack: get last number in segment within segment
lp : L POINT := nil()
someU := hi uSeg
for iu in uNum..0 by -1 repeat
if zero? iu then someU := lo uSeg
-- hack: get last number in segment within segment
pt := ptFun(someU,someV)
numberCheck pt
lp := concat(pt,lp)
someU := someU + ustep
llp := concat(lp,llp)
someV := someV + vstep
-- now llp contains a list of lists of points
-- for a surface that is a result of a function of 2 variables,
-- the main component is open and each sublist is open as well
lProp : L COMPPROP := [ new() for l in llp ]
for aProp in lProp repeat
close(aProp,false)
solid(aProp,false)
aProp : COMPPROP:= new()
close(aProp,false)
solid(aProp,false)
space := sp
mesh(space,llp,lProp,aProp)
space
meshPar2Var(ptFun,uSeg,vSeg,opts) ==
sp := create3Space()
meshPar2Var(sp,ptFun,uSeg,vSeg,opts)
zCoord: (SF,SF,SF) -> SF
zCoord(x,y,z) == z
meshPar2Var(xFun,yFun,zFun,colorFun,uSeg,vSeg,opts) ==
-- the color function should be parameterized by (u,v) as well,
-- not (x,y,z) but we also want some sort of consistency and so
-- changing this over would mean possibly changing the explicit
-- stuff over and there, we probably do want the color function
-- to be parameterized by (x,y,z) - not just (x,y) (this being
-- for convinience only since z is also defined in terms of (x,y)).
(colorFun case Fn3) =>
meshPar2Var(ptFunc(xFun,yFun,zFun,colorFun :: Fn3),uSeg,vSeg,opts)
meshPar2Var(ptFunc(xFun,yFun,zFun,zCoord),uSeg,vSeg,opts)
-- explicit equations of two variables
meshFun2Var(zFun,colorFun,xSeg,ySeg,opts) ==
-- here, we construct the data for a function of two variables
meshPar2Var((z1:SF,z2:SF):SF +-> z1,
(x1:SF,x2:SF):SF +-> x2,zFun,colorFun,xSeg,ySeg,opts)
|