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 🙏

© 2024 – Pkg Stats / Ryan Hefner

ourcad

v1.0.9

Published

OurCAD,一款轻量级的Web-CAD引擎工具。开箱即用,支持CAD图纸多端浏览查看和丰富的图纸操作、图层解析等功能。OurCAD是OurBIM云引擎的模块之一,可与BIM引擎模块联动,支持图模联动、图模融合等功能。

Downloads

4

Readme

OurCAD

介绍

OurCAD,一款轻量级的Web-CAD引擎工具。开箱即用,支持CAD图纸多端浏览查看和丰富的图纸操作、图层解析等功能。OurCAD是OurBIM云引擎的模块之一,可与BIM引擎模块联动,支持图模联动、图模融合等功能、支持CAD图纸中的钢筋符号显示。

安装

npm i ourcad

使用

  • OurCAD主要包含两大功能模块:Viewer和Controller。
  • Viewer用来解析并加载显示图纸、Controller用来对图纸进行精细化操作。部分Controller的图纸操作能力依赖于Viewer的解析数据,所以构建Controller实例时需要传递Viewer实例为参数。
  • 底层用TypeScript实现,对TypeScript有很好的支持。
  • 使用rollup打包,Tree-Shaking机制让SDK更小、ESM模块化机制支持SDK的按需引入。
import { Viewer, Controller } from "ourcad"
const container = document.getElementById('container') as HTMLElement
/**
 * 参数一:图纸绘制容器
 * 参数二:OurBIM图纸管理上传图纸后的fileName 或 本地dxf图纸路径
 */
const VJViewer = new Viewer(container, '20230701165623368')
const VJController = new Controller(VJViewer)

VJController.HomeView()

图纸操作

目前SDK支持:主视图、框选放大、切换背景色、全屏模式、图层显示和隐藏等功能。

示例代码开源

我们开源了基于Vue3.0+TypeScript+Vite的官方SDK示例代码:https://github.com/vanjiancloud/OurCAD

基于现有功能的一些展望

  • 目前OurCAD的SDK免费,用户可以选择将图纸上传到OurBIM享受图纸解析加速服务(不收取任何费用);也可以选择使用SDK加载本地dxf图纸。
  • OurCAD是基于dxf-parser进行重构和扩展,是纯前端完成CAD的解析、绘制、操作一条龙服务,这对于后续SDK的升级维护有着天然的优势。
  • OurCAD目前的图纸绘制是基于three.js渲染,后续会使用最新的webGPU对图纸渲染层进行重构升级,相关工作正在积极筹备当中,请保持关注。
  • 部分AI能力的集成正在路上。
  • SDK的升级维护工作一直在继续,如果您有新的需求,请及时和我们微信联系: