Feature for testing the presence of Three.js

class sage.features.threejs.Threejs(*args, **kwds)[source]

Bases: StaticFile

A Feature which describes the presence of threejs-sage in a few standard locations.

EXAMPLES:

sage: from sage.features.threejs import Threejs
sage: bool(Threejs().is_present())  # needs threejs
True
>>> from sage.all import *
>>> from sage.features.threejs import Threejs
>>> bool(Threejs().is_present())  # needs threejs
True
required_version()[source]

Return the version of threejs that Sage requires.

Defining what version is required is delegated to the distribution package that provides the file threejs-version.txt in sage.ext_data.threejs.

If the file is not provided, "unknown" is returned.

EXAMPLES:

sage: from sage.features.threejs import Threejs
sage: type(Threejs().required_version())
<class 'str'>
sage: Threejs().required_version()                                          # needs sage.plot
'r...'
>>> from sage.all import *
>>> from sage.features.threejs import Threejs
>>> type(Threejs().required_version())
<class 'str'>
>>> Threejs().required_version()                                          # needs sage.plot
'r...'
sage.features.threejs.all_features()[source]