summaryrefslogtreecommitdiff
path: root/graphics/asymptote/base
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-01-08 03:01:04 +0000
committerNorbert Preining <norbert@preining.info>2022-01-08 03:01:04 +0000
commitcd2e7ab7ef89a5c3c1935281009729bff0f357e2 (patch)
treeb2cb311dd3561c52157b2482d6558f9ef76f7136 /graphics/asymptote/base
parentf69513397ac0e1f02c6b4a5f50588d411413271a (diff)
CTAN sync 202201080301
Diffstat (limited to 'graphics/asymptote/base')
-rw-r--r--graphics/asymptote/base/asy.vim372
-rw-r--r--graphics/asymptote/base/geometry.asy2
-rw-r--r--graphics/asymptote/base/patterns.asy4
-rw-r--r--graphics/asymptote/base/three.asy5
-rw-r--r--graphics/asymptote/base/three_surface.asy37
-rw-r--r--graphics/asymptote/base/v3d.asy19
-rw-r--r--graphics/asymptote/base/v3dheadertypes.asy2
-rw-r--r--graphics/asymptote/base/v3dtypes.asy2
8 files changed, 237 insertions, 206 deletions
diff --git a/graphics/asymptote/base/asy.vim b/graphics/asymptote/base/asy.vim
index 4cb897f131..7d0983d07c 100644
--- a/graphics/asymptote/base/asy.vim
+++ b/graphics/asymptote/base/asy.vim
@@ -1,7 +1,7 @@
" Vim syntax file
-" Language: Asymptote
-" Maintainer: Andy Hammerlindl
-" Last Change: 2005 Aug 23
+" Language: Asymptote
+" Maintainer: Andy Hammerlindl
+" Last Change: 2022 Jan 05
" Hacked together from Bram Moolenaar's C syntax file, and Claudio Fleiner's
" Java syntax file.
@@ -9,132 +9,207 @@
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
- syntax clear
+ syn clear
elseif exists("b:current_syntax")
finish
endif
-" A bunch of useful C keywords
-syn keyword asyStatement break return continue unravel
-syn keyword asyConditional if else
-syn keyword asyRepeat while for do
-syn keyword asyExternal access from import include
-syn keyword asyOperator new operator
-
-syn keyword asyTodo contained TODO FIXME XXX
-
-" asyCommentGroup allows adding matches for special things in comments
-syn cluster asyCommentGroup contains=asyTodo
-
-" String and Character constants
-" Highlight special characters (those proceding a double backslash) differently
-syn match asySpecial display contained "\\\\."
-" Highlight line continuation slashes
-syn match asySpecial display contained "\\$"
-syn region asyString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=asySpecial
- " asyCppString: same as asyString, but ends at end of line
-if 0
-syn region asyCppString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=asySpecial
-endif
+" useful C/C++/Java keywords
+syn keyword asyStatement break return continue unravel
+syn keyword asyConditional if else
+syn keyword asyRepeat while for do
+syn keyword asyExternal access from import include
+syn keyword asyOperator new operator
+
+" basic asymptote keywords
+syn keyword asyConstant VERSION
+syn keyword asyConstant true false default infinity inf nan
+syn keyword asyConstant null nullframe nullpath nullpen
+syn keyword asyConstant intMin intMax realMin realMax
+syn keyword asyConstant realEpsilon realDigits
+syn keyword asyPathSpec and cycle controls tension atleast curl
+syn keyword asyStorageClass static public restricted private explicit
+syn keyword asyStructure struct typedef
+syn keyword asyType void bool bool3 int real string file
+syn keyword asyType pair triple transform guide path pen frame
+syn keyword asyType picture
-"when wanted, highlight trailing white space
-if exists("asy_space_errors")
- if !exists("asy_no_trail_space_error")
- syn match asySpaceError display excludenl "\s\+$"
+" module specific keywords
+if exists("asy_syn_plain")
+ syn keyword asyConstant currentpicture currentpen defaultpen
+ syn keyword asyConstant inch inches cm mm bp pt up down right left
+ syn keyword asyConstant E NE N NW W SW S SE
+ syn keyword asyConstant ENE NNE NNW WNW WSW SSW SSE ESE
+ syn keyword asyConstant I pi twopi
+ syn keyword asyConstant CCW CW
+ syn keyword asyConstant undefined sqrtEpsilon Align mantissaBits
+ syn keyword asyConstant identity zeroTransform invert
+ syn keyword asyConstant stdin stdout
+ syn keyword asyConstant unitsquare unitcircle circleprecision
+ syn keyword asyConstant solid dotted Dotted dashed dashdotted
+ syn keyword asyConstant longdashed longdashdotted
+ syn keyword asyConstant squarecap roundcap extendcap
+ syn keyword asyConstant miterjoin roundjoin beveljoin
+ syn keyword asyConstant zerowinding evenodd basealign nobasealign
+ syn keyword asyConstant black white gray red green blue Cyan Magenta
+ syn keyword asyConstant Yellow Black cyan magenta yellow palered
+ syn keyword asyConstant palegreen paleblue palecyan palemagenta
+ syn keyword asyConstant paleyellow palegray lightred lightgreen
+ syn keyword asyConstant lightblue lightcyan lightmagenta lightyellow
+ syn keyword asyConstant lightgray mediumred mediumgreen mediumblue
+ syn keyword asyConstant mediumcyan mediummagenta mediumyellow
+ syn keyword asyConstant mediumgray heavyred heavygreen heavyblue
+ syn keyword asyConstant heavycyan heavymagenta lightolive heavygray
+ syn keyword asyConstant deepred deepgreen deepblue deepcyan
+ syn keyword asyConstant deepmagenta deepyellow deepgray darkred
+ syn keyword asyConstant darkgreen darkblue darkcyan darkmagenta
+ syn keyword asyConstant darkolive darkgray orange fuchsia chartreuse
+ syn keyword asyConstant springgreen purple royalblue salmon brown
+ syn keyword asyConstant olive darkbrown pink palegrey lightgrey
+ syn keyword asyConstant mediumgrey grey heavygrey deepgrey darkgrey
+
+ if exists("asy_syn_texcolors")
+ syn keyword asyConstant GreenYellow Yellow Goldenrod Dandelion
+ syn keyword asyConstant Apricot Peach Melon YellowOrange Orange
+ syn keyword asyConstant BurntOrange Bittersweet RedOrange Mahogany
+ syn keyword asyConstant Maroon BrickRed Red OrangeRed RubineRed
+ syn keyword asyConstant WildStrawberry Salmon CarnationPink Magenta
+ syn keyword asyConstant VioletRed Rhodamine Mulberry RedViolet
+ syn keyword asyConstant Fuchsia Lavender Thistle Orchid DarkOrchid
+ syn keyword asyConstant Purple Plum Violet RoyalPurple BlueViolet
+ syn keyword asyConstant Periwinkle CadetBlue CornflowerBlue
+ syn keyword asyConstant MidnightBlue NavyBlue RoyalBlue Blue
+ syn keyword asyConstant Cerulean Cyan ProcessBlue SkyBlue Turquoise
+ syn keyword asyConstant TealBlue Aquamarine BlueGreen Emerald
+ syn keyword asyConstant JungleGreen SeaGreen Green ForestGreen
+ syn keyword asyConstant PineGreen LimeGreen YellowGreen SpringGreen
+ syn keyword asyConstant OliveGreen RawSienna Sepia Brown Tan Gray
+ syn keyword asyConstant Black White
endif
- if !exists("asy_no_tab_space_error")
- syn match asySpaceError display " \+\t"me=e-1
+
+ if exists("asy_syn_x11colors")
+ syn keyword asyConstant AliceBlue AntiqueWhite Aqua Aquamarine Azure
+ syn keyword asyConstant Beige Bisque Black BlanchedAlmond Blue
+ syn keyword asyConstant BlueViolet Brown BurlyWood CadetBlue
+ syn keyword asyConstant Chartreuse Chocolate Coral CornflowerBlue
+ syn keyword asyConstant Cornsilk Crimson Cyan DarkBlue DarkCyan
+ syn keyword asyConstant DarkGoldenrod DarkGray DarkGreen DarkKhaki
+ syn keyword asyConstant DarkMagenta DarkOliveGreen DarkOrange
+ syn keyword asyConstant DarkOrchid DarkRed DarkSalmon DarkSeaGreen
+ syn keyword asyConstant DarkSlateBlue DarkSlateGray DarkTurquoise
+ syn keyword asyConstant DarkViolet DeepPink DeepSkyBlue DimGray
+ syn keyword asyConstant DodgerBlue FireBrick FloralWhite ForestGreen
+ syn keyword asyConstant Fuchsia Gainsboro GhostWhite Gold Goldenrod
+ syn keyword asyConstant Gray Green GreenYellow Honeydew HotPink
+ syn keyword asyConstant IndianRed Indigo Ivory Khaki Lavender
+ syn keyword asyConstant LavenderBlush LawnGreen LemonChiffon
+ syn keyword asyConstant LightBlue LightCoral LightCyan
+ syn keyword asyConstant LightGoldenrodYellow LightGreen LightGrey
+ syn keyword asyConstant LightPink LightSalmon LightSeaGreen
+ syn keyword asyConstant LightSkyBlue LightSlateGray LightSteelBlue
+ syn keyword asyConstant LightYellow Lime LimeGreen Linen Magenta
+ syn keyword asyConstant Maroon MediumAquamarine MediumBlue
+ syn keyword asyConstant MediumOrchid MediumPurple MediumSeaGreen
+ syn keyword asyConstant MediumSlateBlue MediumSpringGreen
+ syn keyword asyConstant MediumTurquoise MediumVioletRed MidnightBlue
+ syn keyword asyConstant MintCream MistyRose Moccasin NavajoWhite
+ syn keyword asyConstant Navy OldLace Olive OliveDrab Orange
+ syn keyword asyConstant OrangeRed Orchid PaleGoldenrod PaleGreen
+ syn keyword asyConstant PaleTurquoise PaleVioletRed PapayaWhip
+ syn keyword asyConstant PeachPuff Peru Pink Plum PowderBlue Purple
+ syn keyword asyConstant Red RosyBrown RoyalBlue SaddleBrown Salmon
+ syn keyword asyConstant SandyBrown SeaGreen Seashell Sienna Silver
+ syn keyword asyConstant SkyBlue SlateBlue SlateGray Snow SpringGreen
+ syn keyword asyConstant SteelBlue Tan Teal Thistle Tomato Turquoise
+ syn keyword asyConstant Violet Wheat White WhiteSmoke Yellow
+ syn keyword asyConstant YellowGreen
endif
-endif
-"catch errors caused by wrong parenthesis and brackets
-syn cluster asyParenGroup contains=asyParenError,asyIncluded,asySpecial,asyCommentSkip,asyCommentString,asyComment2String,@asyCommentGroup,asyCommentStartError,asyUserCont,asyUserLabel,asyBitField,asyCommentSkip,asyOctalZero,asyCppOut,asyCppOut2,asyCppSkip,asyFormat,asyNumber,asyFloat,asyOctal,asyOctalError,asyNumbersCom
-if exists("asy_no_bracket_error")
- syn region asyParen transparent start='(' end=')' contains=ALLBUT,@asyParenGroup,asyCppParen,asyCppString
- " asyCppParen: same as asyParen but ends at end-of-line; used in asyDefine
- syn region asyCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@asyParenGroup,asyParen,asyString
- syn match asyParenError display ")"
- syn match asyErrInParen display contained "[{}]"
-else
- syn region asyParen transparent start='(' end=')' contains=ALLBUT,@asyParenGroup,asyCppParen,asyErrInBracket,asyCppBracket,asyCppString
- " asyCppParen: same as asyParen but ends at end-of-line; used in asyDefine
- syn region asyCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@asyParenGroup,asyErrInBracket,asyParen,asyBracket,asyString
-if 0
- syn match asyParenError display "[\])]"
- syn match asyErrInParen display contained "[\]]"
-endif
- syn region asyBracket transparent start='\[' end=']' contains=ALLBUT,@asyParenGroup,asyErrInParen,asyCppParen,asyCppBracket,asyCppString
- " asyCppBracket: same as asyParen but ends at end-of-line; used in asyDefine
- syn region asyCppBracket transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@asyParenGroup,asyErrInParen,asyParen,asyBracket,asyString
- syn match asyErrInBracket display contained "[);]"
+ if exists("asy_syn_three")
+ syn keyword asyType path3 guide3 transform3
+ syn keyword asyType projection light material patch surface tube
+ syn keyword asyConstant currentprojection currentlight defaultrender
+ syn keyword asyConstant identity4 O X Y Z
+ syn keyword asyConstant nolight nullpens
+ syn keyword asyConstant unitsphere unithemisphere unitplane octant1
+ syn keyword asyConstant unitcone unitsolidcone unitcube unitcylinder
+ syn keyword asyConstant unitdisk unittube
+ endif
endif
-"integer number, or floating point number without a dot and with "f".
-syn case ignore
-syn match asyNumbers display transparent "\<\d\|\.\d" contains=asyNumber,asyFloat
-syn match asyNumber display contained "\d\+"
-"floating point number, with dot, optional exponent
-syn match asyFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\="
-"floating point number, starting with a dot, optional exponent
-syn match asyFloat display contained "\.\d\+\(e[-+]\=\d\+\)\="
-"floating point number, without dot, with exponent
-syn match asyFloat display contained "\d\+e[-+]\=\d\+"
-syn case match
+" string constants
+syn region asyCString start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=asyCSpecial
+syn match asyCSpecial display contained +\\\(['"?\\abfnrtv]\|\o\{1,3}\)+
+syn match asyCSpecial display contained +\\\(x[0-9A-F]\{1,2\}\|$\)+
+" double quoted strings only special character is \"
+syn region asyString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=asySpecial
+syn match asySpecial display contained +\(\\\)\@1<!\(\\\\\)*\zs\\"+
+
+
+" number constants
+syn match asyNumbers display transparent "\<\d\|\.\d"
+ \ contains=asyNumber,asyNumberError
+syn match asyNumber display contained "\d*\.\=\d*\(e[-+]\=\d\+\)\="
+" highlight number constants with two '.' or with '.' after an 'e'
+syn match asyNumberError display contained "\d*\.\(\d\|e[-+]\=\)*\.[0-9.]*"
+syn match asyNumberError display contained "\d*e[-+]\=\d*\.[0-9.]*"
+syn match asyNumberError display contained "\d*e[-+]\=\(e[-+]\=\)*\.[0-9.]*"
+
+
+" comments and comment strings
+syn keyword asyTodo contained TODO FIXME XXX
+syn sync ccomment asyComment minlines=15
if exists("asy_comment_strings")
- " A comment can contain asyString, asyCharacter and asyNumber.
- " But a "*/" inside a asyString in a asyComment DOES end the comment! So we
- " need to use a special type of asyString: asyCommentString, which also ends on
+ " A comment can contain asyString, asyCString, and asyNumber. But a "*/"
+ " inside a asy*String in a asyComment DOES end the comment! So we need to
+ " use a special type of asy*String: asyComment*String, which also ends on
" "*/", and sees a "*" at the start of the line as comment again.
" Unfortunately this doesn't very well work for // type of comments :-(
- syntax match asyCommentSkip contained "^\s*\*\($\|\s\+\)"
- syntax region asyCommentString contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=asySpecial,asyCommentSkip
- syntax region asyComment2String contained start=+L\="+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=asySpecial
- syntax region asyCommentL start="//" skip="\\$" end="$" keepend contains=@asyCommentGroup,asyComment2String,asyCharacter,asyNumbersCom,asySpaceError
- syntax region asyComment matchgroup=asyCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@asyCommentGroup,asyCommentStartError,asyCommentString,asyCharacter,asyNumbersCom,asySpaceError
+ syn match asyCommentSkip contained "^\s*\*\($\|\s\+\)"
+ syn region asyCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+ \ end=+\*/+me=s-1
+ \ contains=asySpecial,asyCommentSkip
+ syn region asyCommentCString contained start=+'+ skip=+\\\\\|\\'+ end=+'+
+ \ end=+\*/+me=s-1
+ \ contains=asyCSpecial,asyCommentSkip
+ syn region asyCommentLString contained start=+"+ skip=+\\\\\|\\"+ end=+"+
+ \ end="$" contains=asySpecial
+ syn region asyCommentLCString contained start=+'+ skip=+\\\\\|\\'+ end=+'+
+ \ end="$" contains=asyCSpecial
+ syn region asyCommentL start="//" skip="\\$" end="$" keepend
+ \ contains=asyTodo,asyCommentLString,
+ \ asyCommentLCString,asyNumbers
+ syn region asyComment matchgroup=asyComment start="/\*" end="\*/"
+ \ contains=asyTodo,asyCommentStartError,
+ \ asyCommentString,asyCommentCString,asyNumbers
else
- syn region asyCommentL start="//" skip="\\$" end="$" keepend contains=@asyCommentGroup,asySpaceError
- syn region asyComment matchgroup=asyCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@asyCommentGroup,asyCommentStartError,asySpaceError
+ syn region asyCommentL start="//" skip="\\$" end="$" keepend
+ \ contains=asyTodo
+ syn region asyComment matchgroup=asyComment start="/\*" end="\*/"
+ \ contains=asyTodo,asyCommentStartError
endif
-" keep a // comment separately, it terminates a preproc. conditional
-syntax match asyCommentError display "\*/"
-syntax match asyCommentStartError display "/\*"me=e-1 contained
-syn keyword asyType void bool int real string
-syn keyword asyType pair triple transform guide path pen frame
-syn keyword asyType picture
+" highlight common errors when starting/ending C comments
+syn match asyCommentError display "\*/"
+syn match asyCommentStartError display "/\*"me=e-1 contained
-syn keyword asyStructure struct typedef
-syn keyword asyStorageClass static public readable private explicit
-syn keyword asyPathSpec and cycle controls tension atleast curl
+" delimiter matching errors
+syn region asyCurly transparent start='{' end='}'
+ \ contains=TOP,asyCurlyError
+syn region asyBrack transparent start='\[' end='\]' matchgroup=asyError
+ \ end=';' contains=TOP,asyBrackError
+syn region asyParen transparent start='(' end=')' matchgroup=asyError
+ \ end=';' contains=TOP,asyParenError
+syn match asyCurlyError display '}'
+syn match asyBrackError display '\]'
+syn match asyParenError display ')'
+" for (;;) constructs are exceptions that allow ; inside parenthesis
+syn region asyParen transparent matchgroup=asyParen
+ \ start='\(for\s*\)\@<=(' end=')'
+ \ contains=TOP,asyParenError
-syn keyword asyConstant true false
-syn keyword asyConstant null nullframe nullpath
-
-if exists("asy_syn_plain")
- syn keyword asyConstant currentpicture currentpen currentprojection
- syn keyword asyConstant inch inches cm mm bp pt up down right left
- syn keyword asyConstant E NE N NW W SW S SE
- syn keyword asyConstant ENE NNE NNW WNW WSW SSW SSE ESE
- syn keyword asyConstant I pi twopi
- syn keyword asyConstant solid dotted dashed dashdotted
- syn keyword asyConstant longdashed longdashdotted
- syn keyword asyConstant squarecap roundcap extendcap
- syn keyword asyConstant miterjoin roundjoin beveljoin
- syn keyword asyConstant zerowinding evenodd
- syn keyword asyConstant invisible black gray grey white
- syn keyword asyConstant lightgray lightgrey
- syn keyword asyConstant red green blue
- syn keyword asyConstant cmyk Cyan Magenta Yellow Black
- syn keyword asyConstant yellow magenta cyan
- syn keyword asyConstant brown darkgreen darkblue
- syn keyword asyConstant orange purple royalblue olive
- syn keyword asyConstant chartreuse fuchsia salmon lightblue springgreen
- syn keyword asyConstant pink
-endif
-
-syn sync ccomment asyComment minlines=15
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
@@ -147,56 +222,39 @@ if version >= 508 || !exists("did_asy_syn_inits")
command -nargs=+ HiLink hi def link <args>
endif
- HiLink asyFormat asySpecial
- HiLink asyCppString asyString
- HiLink asyCommentL asyComment
- HiLink asyCommentStart asyComment
- HiLink asyLabel Label
- HiLink asyUserLabel Label
- HiLink asyConditional Conditional
- HiLink asyRepeat Repeat
- HiLink asyCharacter Character
- HiLink asySpecialCharacter asySpecial
- HiLink asyNumber Number
- HiLink asyOctal Number
- HiLink asyOctalZero PreProc " link this to Error if you want
- HiLink asyFloat Float
- HiLink asyOctalError asyError
- HiLink asyParenError asyError
- HiLink asyErrInParen asyError
- HiLink asyErrInBracket asyError
- HiLink asyCommentError asyError
- HiLink asyCommentStartError asyError
- HiLink asySpaceError asyError
- HiLink asySpecialError asyError
- HiLink asyOperator Operator
- HiLink asyStructure Structure
- HiLink asyStorageClass StorageClass
- HiLink asyExternal Include
- HiLink asyPreProc PreProc
- HiLink asyDefine Macro
- HiLink asyIncluded asyString
- HiLink asyError Error
- HiLink asyStatement Statement
- HiLink asyPreCondit PreCondit
- HiLink asyType Type
- HiLink asyConstant Constant
- HiLink asyCommentString asyString
- HiLink asyComment2String asyString
- HiLink asyCommentSkip asyComment
- HiLink asyString String
- HiLink asyComment Comment
- HiLink asySpecial SpecialChar
- HiLink asyTodo Todo
- HiLink asyCppSkip asyCppOut
- HiLink asyCppOut2 asyCppOut
- HiLink asyCppOut Comment
- HiLink asyPathSpec Statement
-
+ HiLink asyCommentL asyComment
+ HiLink asyConditional Conditional
+ HiLink asyRepeat Repeat
+ HiLink asyNumber Number
+ HiLink asyNumberError asyError
+ HiLink asyCurlyError asyError
+ HiLink asyBracketError asyError
+ HiLink asyParenError asyError
+ HiLink asyCommentError asyError
+ HiLink asyCommentStartError asyError
+ HiLink asyOperator Operator
+ HiLink asyStructure Structure
+ HiLink asyStorageClass StorageClass
+ HiLink asyExternal Include
+ HiLink asyDefine Macro
+ HiLink asyError Error
+ HiLink asyStatement Statement
+ HiLink asyType Type
+ HiLink asyConstant Constant
+ HiLink asyCommentString asyString
+ HiLink asyCommentCString asyString
+ HiLink asyCommentLString asyString
+ HiLink asyCommentLCString asyString
+ HiLink asyCommentSkip asyComment
+ HiLink asyString String
+ HiLink asyCString String
+ HiLink asyComment Comment
+ HiLink asySpecial SpecialChar
+ HiLink asyCSpecial SpecialChar
+ HiLink asyTodo Todo
+ HiLink asyPathSpec Statement
delcommand HiLink
endif
let b:current_syntax = "c"
-
-" vim: ts=8
diff --git a/graphics/asymptote/base/geometry.asy b/graphics/asymptote/base/geometry.asy
index 420d5bdc45..9f4be8d15c 100644
--- a/graphics/asymptote/base/geometry.asy
+++ b/graphics/asymptote/base/geometry.asy
@@ -6051,7 +6051,7 @@ triangle extouch(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type="triangle" signature="extouch(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="incentral(triangle)"><code></asyxml>*/
triangle incentral(triangle t)
{/*<asyxml></code><documentation>Return the incentral triangle of the triangle 't'.
It is the triangle whose vertices are determined by the intersections of the
diff --git a/graphics/asymptote/base/patterns.asy b/graphics/asymptote/base/patterns.asy
index e71690fbe9..de0fc02d03 100644
--- a/graphics/asymptote/base/patterns.asy
+++ b/graphics/asymptote/base/patterns.asy
@@ -13,9 +13,9 @@ frame tiling(string name, picture pic, pair lb=0, pair rt=0)
/XStep "+format(s,pmax.x-pmin.x,"C")+"
/YStep "+format(s,pmax.y-pmin.y,"C")+"
/PaintProc {pop");
- begingroup(tiling);
+ gsave(tiling);
add(tiling,f);
- endgroup(tiling);
+ grestore(tiling);
postscript(tiling,"} >>
matrix makepattern
/"+name+" exch def");
diff --git a/graphics/asymptote/base/three.asy b/graphics/asymptote/base/three.asy
index ab30848444..c208f59df8 100644
--- a/graphics/asymptote/base/three.asy
+++ b/graphics/asymptote/base/three.asy
@@ -56,8 +56,6 @@ struct render
// General parameters:
real margin; // shrink amount for rendered openGL viewport, in bp.
- bool labelfill; // fill PRC subdivision cracks in unlighted labels
-
bool partnames; // assign part name indices to compound objects
bool defaultnames; // assign default names to unnamed objects
interaction interaction; // billboard interaction mode
@@ -72,7 +70,6 @@ struct render
bool3 merge=render.merge,
int sphere=render.sphere,
real margin=render.margin,
- bool labelfill=render.labelfill,
bool partnames=render.partnames,
bool defaultnames=render.defaultnames,
interaction interaction=render.interaction)
@@ -84,7 +81,6 @@ struct render
this.merge=merge;
this.sphere=sphere;
this.margin=margin;
- this.labelfill=labelfill;
this.partnames=partnames;
this.defaultnames=defaultnames;
this.interaction=interaction;
@@ -101,7 +97,6 @@ defaultrender.tessellate=false;
defaultrender.merge=false;
defaultrender.margin=0.02;
defaultrender.sphere=NURBSsphere;
-defaultrender.labelfill=true;
defaultrender.partnames=false;
defaultrender.defaultnames=true;
defaultrender.interaction=Embedded;
diff --git a/graphics/asymptote/base/three_surface.asy b/graphics/asymptote/base/three_surface.asy
index e993c8d713..d0d79de464 100644
--- a/graphics/asymptote/base/three_surface.asy
+++ b/graphics/asymptote/base/three_surface.asy
@@ -1380,6 +1380,7 @@ void draw3D(frame f, patch s, material m,
int digits=s.planar && !straight ? 12 : settings.digits;
if(s.colors.length > 0) {
+ primitive=false;
if(prc() && light.on())
straight=false; // PRC vertex colors (for quads only) ignore lighting
m=material(m);
@@ -1489,8 +1490,6 @@ void draw(picture pic=currentpicture, triple[] v, int[][] vi,
project(v[vii[2]],P)--cycle;
pen p=color(n[ni[i][0]],m,light);
fill(pic,g,p);
- if(prc && opacity(m.diffuse()) == 1) // Fill subdivision cracks
- draw(pic,g,p);
}
}
}
@@ -1538,8 +1537,11 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
bool prc=prc();
if(s.draw != null && (primitive() || (prc && s.PRCprimitive))) {
bool noprerender=settings.prerender == 0;
- for(int k=0; k < s.s.length; ++k)
- draw3D(f,s.s[k],surfacepen[k],light,render,primitive=noprerender);
+ for(int k=0; k < s.s.length; ++k) {
+ patch p=s.s[k];
+ draw3D(f,p,surfacepen[k],light,render,primitive=noprerender);
+ if(p.colors.length > 0) noprerender=false;
+ }
if(noprerender)
s.draw(f,s.T,surfacepen,light,render);
} else {
@@ -1851,13 +1853,8 @@ void label(frame f, Label L, triple position, align align=NoAlign,
begingroup3(f2,Render);
begingroup3(f3,Render);
}
- for(patch S : s.s) {
- S=centering*S;
- draw3D(f3,S,L.p,light,Render);
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f3,S.external(),position,L.p,light,interaction);
- }
+ for(patch S : s.s)
+ draw3D(f3,centering*S,L.p,light,Render);
endgroup3(f3);
if(L.defaulttransform3)
add(f1,T*f3);
@@ -1874,9 +1871,6 @@ void label(frame f, Label L, triple position, align align=NoAlign,
triple V=L.align.is3D ? position+L.align.dir3*labelmargin(L.p) :
position;
draw3D(f,S,L.p,light,render(interaction(interaction,center=V)));
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f,S.external(),V,L.p,light,interaction);
}
endgroup3(f);
}
@@ -1941,13 +1935,8 @@ void label(picture pic=currentpicture, Label L, triple position,
begingroup3(f2,Render);
begingroup3(f3,Render);
}
- for(patch S : s.s) {
- S=centering*S;
- draw3D(f3,S,L.p,light,Render);
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f3,S.external(),v,L.p,light,interaction);
- }
+ for(patch S : s.s)
+ draw3D(f3,centering*S,L.p,light,Render);
endgroup3(f3);
if(L.defaulttransform3)
add(f1,T*f3);
@@ -1963,11 +1952,7 @@ void label(picture pic=currentpicture, Label L, triple position,
begingroup3(f,name,render);
for(patch S : surface(L,v,bbox=P.bboxonly).s) {
triple V=L.align.is3D ? v+L.align.dir3*labelmargin(L.p) : v;
- render Render=render(render,interaction(interaction,V));
- draw3D(f,S,L.p,light,Render);
- // Fill subdivision cracks
- if(prc && render.labelfill && opacity(L.p) == 1 && !lighton)
- _draw(f,S.external(),V,L.p,light,interaction);
+ draw3D(f,S,L.p,light,render(render,interaction(interaction,V)));
}
endgroup3(f);
}
diff --git a/graphics/asymptote/base/v3d.asy b/graphics/asymptote/base/v3d.asy
index 0405a5d5bc..925ba505e4 100644
--- a/graphics/asymptote/base/v3d.asy
+++ b/graphics/asymptote/base/v3d.asy
@@ -461,17 +461,10 @@ struct v3dfile
for (int i=0; i < nI; ++i) {
xdrfile.dimension(3);
g.positionIndices[i]=xdrfile;
- if(explicitNI != 0)
- g.normalIndices[i]=xdrfile;
- else
- g.normalIndices[i]=g.positionIndices[i];
- if(nC > 0) {
- if(explicitCI != 0)
- g.colorIndices[i]=xdrfile;
- else
- g.colorIndices[i]=g.positionIndices[i];
- } else
- g.colorIndices[i]=g.positionIndices[i];
+ g.normalIndices[i]=explicitNI != 0 ? xdrfile :
+ g.positionIndices[i];
+ g.colorIndices[i]=nC > 0 && explicitCI != 0 ? xdrfile :
+ g.positionIndices[i];
}
int center=xdrfile;
int material=xdrfile;
@@ -606,9 +599,9 @@ void importv3d(string name)
path3[][] G=xf.paths3[c];
for(int m=0; m < G.length; ++m)
if(G.initialized(m)) {
- material material=xf.materials[m];
+ material material=material(xf.materials[m]);
material.p[0] += thin();
- draw(G[m],material,r);
+ draw(G[m],material,currentlight,r);
}
}
diff --git a/graphics/asymptote/base/v3dheadertypes.asy b/graphics/asymptote/base/v3dheadertypes.asy
index 19fad67eee..87a255db48 100644
--- a/graphics/asymptote/base/v3dheadertypes.asy
+++ b/graphics/asymptote/base/v3dheadertypes.asy
@@ -1,6 +1,6 @@
// Enum class for v3dheadertypes
// AUTO-GENERATED from v3dheadertypes.csv
-// Generated at 2022-01-01 13:56:00.166634
+// Generated at 2022-01-06 15:01:16.486016
struct v3dheadertypes
{
diff --git a/graphics/asymptote/base/v3dtypes.asy b/graphics/asymptote/base/v3dtypes.asy
index 3611e586ea..183b6a9bac 100644
--- a/graphics/asymptote/base/v3dtypes.asy
+++ b/graphics/asymptote/base/v3dtypes.asy
@@ -1,6 +1,6 @@
// Enum class for v3dtypes
// AUTO-GENERATED from v3dtypes.csv
-// Generated at 2022-01-01 13:56:00.084723
+// Generated at 2022-01-06 15:01:16.457740
struct v3dtypes
{