惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - 莫小龙

uniapp之plus.downloader.createDownload下载文件传参 谷歌之将网页保存为图片 elementui之table中相同数据的单元格合并 krpano之使用教程 threejs之灯光不跟随OrbitControls控制器旋转 threejs之将张纹理图片组成材质组 canvas之修改Base64图片中不透明部分的颜色 threejs之将PlaneGeometry转换为BufferGeometry threejs之添加渐变背景 threejs之创建发光墙体 paperjs之fitBounds适应区域前后屏幕坐标和输入坐标的转换 arcmap之通过点数据获取等值线 uniapp之安卓APP打开百度地图、高德地图APP openlayer之添加带箭头的线 geoserver之图片图标样式 SHP转WKT文件工具 openlayers之geoserver的wms图层mysql数据源数据修改后更新问题 通过日照时数计算每天RAD(太阳辐射)值 Uniapp之安卓签名证书(.keystore)生成
threejs之利用shape通过线绘制面和体
莫小龙 · 2025-06-20 · via 博客园 - 莫小龙

threejs之利用shape通过线绘制面和体

            var smileyShape = new THREE.Shape();
            smileyShape.moveTo(80, 40);
            smileyShape.absarc(40, 40, 40, 0, Math.PI * 2, false);// 主模型

            var smileyEye1Path = new THREE.Path();
            smileyEye1Path.moveTo(35, 20);
            smileyEye1Path.absellipse(25, 20, 10, 10, 0, Math.PI * 2, true);

            smileyShape.holes.push(smileyEye1Path);// 挖洞

            var smileyEye2Path = new THREE.Path();
            smileyEye2Path.moveTo(65, 20);
            smileyEye2Path.absarc(55, 20, 10, 0, Math.PI * 2, true);
            smileyShape.holes.push(smileyEye2Path);// 挖洞

            var smileyMouthPath = new THREE.Path();
            smileyMouthPath.moveTo(20, 40);
            smileyMouthPath.quadraticCurveTo(40, 60, 60, 40);
            smileyMouthPath.bezierCurveTo(70, 45, 70, 50, 60, 60);
            smileyMouthPath.quadraticCurveTo(40, 80, 20, 60);
            smileyMouthPath.quadraticCurveTo(5, 50, 20, 40);

            // smileyShape.holes.push(smileyMouthPath);// 挖洞
            // 创建面
            const geometryShape = new THREE.ShapeGeometry(smileyShape);
            // 拉伸厚度
            // const extrudeSettings = { depth: 10, bevelEnabled: false };
            // const geometryShape = new THREE.ExtrudeGeometry(smileyShape, extrudeSettings);
            const materialShape = new THREE.MeshBasicMaterial({
                color: 0x00ffff,
                side: THREE.DoubleSide,
                transparent: true,
                opacity: 0.5,
            });
            const smileymesh = new THREE.Mesh(geometryShape, materialShape);
            scene.add(smileymesh)

  效果:

。。。。。钻研不易转载请注明出处