{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# three.js tests"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'SageMath version 9.0.beta4, Release Date: 2019-11-02'"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"version()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Test illustrating some opacity issues discussed in [#22408](https://trac.sagemath.org/ticket/22408):"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Graphics3d Object"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"var('x y z a b')\n",
"E1 = x^2 + y^2 + z^2 - a^2 == 0\n",
"E2 = x^2 + y^2 - b^2*z^2 == 0\n",
"P1 = implicit_plot3d(E1.lhs().subs([a==2]),(x, -2, 2), (y, -2, 2), (z, -2, 2),\n",
" color=\"blue\", opacity=0.5)\n",
"P2 = implicit_plot3d(E2.lhs().subs([b==1]),(x, -2, 2), (y, -2, 2), (z, -2, 2),\n",
" color=\"yellow\", opacity=0.5)\n",
"P1 + P2"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Graphics3d Object"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"polytopes.dodecahedron().plot(opacity=.5)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Test of the option `single_side` introduced in [#28702](https://trac.sagemath.org/ticket/28702):"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n"
],
"text/plain": [
"Graphics3d Object"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"polytopes.dodecahedron().plot(opacity=.5, single_side=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "SageMath 9.0.beta4",
"language": "sage",
"name": "sagemath"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}