npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xhopcfine/aster-plugin-model3d

v0.1.3

Published

Aster 本地 AI 3D 建模插件:由 Aster 生成 JSCAD 代码,本机预览并导出 STL。

Downloads

610

Readme

@xhopcfine/aster-plugin-model3d

Aster 本地 AI 3D 建模插件。

用户在 Aster 对话里描述想要的 3D 模型,Aster 生成或修改 JSCAD 建模代码;插件在本机保存、执行、预览并导出 STL 文件。预览界面基于 Three.js,建模执行基于 JSCAD。

这个插件不是固定参数模板,也不依赖外部 3D 生成服务。模型结构由 Aster 生成的 JSCAD 代码决定,适合做可 3D 打印的小工具、结构件、支架、盒体、孔位、加强筋等偏工程化的模型原型。

功能

  • 在 Aster 对话中用中文描述 3D 模型需求
  • 由 Aster 生成完整 JSCAD 建模代码
  • 本机执行 JSCAD 代码并生成模型网格
  • 启动本地网页预览模型
  • 在网页中查看、旋转、缩放模型
  • 手动查看或微调 JSCAD 代码
  • 导出 STL 文件用于切片或 3D 打印
  • 模型项目保存在本机 Aster 插件数据目录

安装

先全局安装 Aster:

npm install -g aster-agent@latest --registry=https://registry.npmjs.org/

再全局安装 3D 建模插件:

npm install -g @xhopcfine/aster-plugin-model3d@latest --registry=https://registry.npmjs.org/

启用插件:

aster plugins install model3d --package @xhopcfine/aster-plugin-model3d --enabled

启动 Aster:

aster

启动后,在 Aster 对话里直接描述 3D 建模需求即可。

Aster 对话示例

启动 3D 建模预览
帮我用 JSCAD 做一个可 3D 打印的手机支架,宽 80mm,深 70mm,背板高 120mm,有两个螺丝孔
修改刚才的 JSCAD 模型:底座加厚到 6mm,螺丝孔改成 5mm,再加两个加强筋
导出当前模型 STL

更多示例:

做一个桌面线缆固定夹,底部有双面胶平面,中间有 4 条线槽,每条线槽宽 5mm
把模型改成圆角外壳,四角加螺丝柱,上盖留出一个 20mm x 12mm 的接口开孔
查看当前 3D 建模插件状态

预览网页

插件会启动一个本地 HTTP 服务,默认地址:

http://127.0.0.1:5188

如果端口被占用,Aster 可以通过工具参数指定其他端口。网页主要用于预览、检查和必要时手动编辑 JSCAD 代码;主要建模流程仍然是在 Aster 对话中完成。

JSCAD 代码能力

插件会在本机沙箱中执行 Aster 生成的 JSCAD 代码。为了让 AI 生成代码更稳定,插件开放了常见 JSCAD 写法:

const { cuboid, cylinder } = primitives;
const { translate, rotateZ } = transforms;
const { union, subtract } = booleans;

function main() {
  return union(
    cuboid({ size: [40, 30, 10] }),
    translate([0, 0, 10], cylinder({ radius: 8, height: 20 }))
  );
}

也支持:

const { primitives, transforms, booleans } = require("@jscad/modeling");

以及常见 JSCAD import 写法,插件会自动转换后执行:

import { cuboid } from "@jscad/modeling/src/primitives";
import { union } from "@jscad/modeling/src/operations/booleans";

开放的 JSCAD 模块包括:primitivestransformsbooleanscolorsgeometriesmeasurementsmathsextrusionshullsexpansionsmodifierscurvestextutils

插件不开放 fspathhttpchild_process 等 Node 模块,不开放读取本机文件,也不开放导入其他 npm 包。

工具

| 工具 | 作用 | | --- | --- | | model3d_start_preview | 启动本地 3D 预览网页 | | model3d_status | 查看插件状态和数据目录 | | model3d_list_projects | 列出本地模型项目 | | model3d_create_from_code | 保存并执行 Aster 生成的 JSCAD 代码 | | model3d_update_code | 用新的 JSCAD 代码修改当前模型 | | model3d_export_stl | 导出 STL 文件 | | model3d_url | 查看预览网页地址 |

本地数据

模型项目保存在 Aster 分配给插件的本机数据目录中。插件只启动本机 HTTP 服务和本地建模计算,不需要外部数据库或外部 3D 服务。

隐私说明

  • 插件本身不连接 GitHub、Slack、云数据库或第三方 3D 生成服务
  • JSCAD 代码执行、模型预览和 STL 导出都在本机完成
  • 模型数据保存在本机 Aster 插件数据目录

注意:插件会执行 Aster 生成的 JSCAD JavaScript 建模代码。当前实现做了基础执行限制,但在生产环境中仍建议只运行可信 Aster 会话生成的模型代码。

环境要求

  • Node.js 20 到 24
  • Aster aster-agent

适用场景

  • 3D 打印结构件原型
  • 手机支架、线缆夹、收纳盒、安装支架等小工具
  • 带孔位、加强筋、圆角、开槽的工程化模型草稿
  • 用中文自然语言快速生成可继续修改的 JSCAD 模型代码