爱心:
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val < 0.8) {
return (val = -val + Math.sin(v));
}
if (val > 0.8) {
return (val = -val + Math.sin(v));
}
return Math.cos(v);
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val < 0.1) {
return;
}
if (val < 0.7) {
return (val = -val + Math.sin(v));
}
return Math.cos(v);
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val < 0.1) {
return;
}
if (val < 0.9) {
return (val = -val + Math.sin(v));
}
return Math.cos(v);
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val < 0.1) {
return;
}
if (val > 0) {
return (val = -val - Math.sin(v));
}
return Math.cos(v);
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val > 0) {
return (val = -val - Math.sin(v));
}
// if (val < 0) {
// return (val = -(-val - Math.sin(v)));
// }
return -val + Math.sin(v);
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val > 0) {
return (val = val + Math.cos(v));
}
// if (val < 0) {
// return (val = -(-val - Math.sin(v)));
// }
return --val + Math.cos(v);
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val > 0) {
return (val = -val - Math.sin(v));
}
// if (val < 0) {
// return (val = -(-val - Math.sin(v)));
// }
return -val + Math.sin(v) - 2;
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "#313695",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 30,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val > 0) {
return (val = -val - Math.sin(v));
}
// if (val < 0) {
// return (val = -(-val - Math.sin(v)));
// }
return -val + Math.sin(v) - 3;
},
},
},
],
series: [
{
type: "surface",
parametric: true,
// 改变球体颜色
itemStyle: {
color: function (params) {
return "transparent";
},
},
// coordinateSystem: "globe",
blendMode: "lighter",
// shading: "albedo",
// 改变线条颜色
wireframe: {
lineStyle: {
width: 1,
color: "red",
opacity: 1,
},
},
parametricEquation: {
u: {
min: -Math.PI,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
v: {
min: 0,
max: Math.PI,
step: Math.PI / 20,
// 步长
},
x: function (u, v) {
// console.log(Math.sin(v) * Math.sin(u) + 4);
// let val = Math.sin(v) * Math.sin(u) + 4;
// if (val > 3.5) {
// return (val = -val);
// }
return Math.sin(v) * Math.sin(u);
},
y: function (u, v) {
return Math.sin(v) * Math.cos(u);
},
z: function (u, v) {
let val = Math.cos(v);
console.log(val);
if (val < 0.8) {
return (val = -val + Math.sin(v)) + 3;
}
if (val > 0.8) {
return (val = -val + Math.sin(v)) + 3;
}
return Math.cos(v) + 2;
},
},
},
],
转载:https://blog.csdn.net/weixin_46476460/article/details/112984949
查看评论