项目介绍

pattern-x/gemini-viewer-examples 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,目前获得 285 个 Star、50 次 Fork。

仓库全名
pattern-x/gemini-viewer-examples
Star 数
285
Fork 数
50
未关闭 Issue
29

README 摘要

gemini-viewer-examples Examples and demos for gemini-viewer sdk. Online examples Online demos Set up the example project npm install npm start http://localhost:3000/ gemini-viewer gemini-viewer is a WebGL based JS SDK, it is built on top of three.js. It provides following viewers: 1. DxfViewer Used to view 2d drawings and PDF. For dwg, we need to convert it to dxf first (there is a dwg2dxf.exe worker). It supports…

完整内容见 GitHub 原始 README 或本页 。

常见问题

gemini-viewer-examples 用什么语言开发?

主要使用 TypeScript 编写,目前有 285 个 Star。

如何获取 gemini-viewer-examples 的源码?

可以直接克隆仓库:git clone https://github.com/pattern-x/gemini-viewer-examples.git,默认分支为 main;安装与运行步骤见仓库 README。

gemini-viewer-examples 最近还在维护吗?

仓库最近一次更新为 1月22日,当前有 29 个未关闭 Issue;Star 数为 285,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Examples and demos for gemini-viewer sdk, which is a WebGL based BIM model viewer, built on three.js. It is used to view dwg/dxf, gltf, obj, ifc models, etc.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
395
价值分
185
活跃状态
活跃

语言占比

CSS
HTML
JavaScript
TypeScript

Release

README

gemini-viewer-examples

Examples and demos for gemini-viewer sdk.

Set up the example project

npm install

npm start

http://localhost:3000/

gemini-viewer

gemini-viewer is a WebGL based JS SDK, it is built on top of three.js. It provides following viewers:

1. DxfViewer

Used to view 2d drawings and PDF. For dwg, we need to convert it to dxf first (there is a dwg2dxf.exe worker). It supports most common entity types, it supports OLE and region via dwg2dxf; It supports common line types; It supports common hatch styles; It support line width;

2. BimViewer

Used to view 3d BIM models. It supports formats including gltf, obj, fbx, ifc, dae, etc. Its features including measurement, section, display outline, orthographic camera, selection, etc.

3. VRViewer

Used to view panoramas. It supports viewing a panorama with 1 image, 6 images, or 24 images; It supports viewing a serials of panoramas; It supports hotpoints;

Installation

To install from npm:

npm install @pattern-x/gemini-viewer-threejs

Examples for DxfViewer

import { DxfViewer, DxfViewerConfig, ModelConfig } from "@pattern-x/gemini-viewer-threejs";

const viewerCfg: DxfViewerConfig = {
    containerId: "myCanvas",
    enableSpinner: true,
    enableLayoutBar: true,
};
const modelCfg: ModelConfig = {
    modelId: "id_0",
    name: "sample",
    src: "http://www.abc.com/sample.dxf",
}
const fontFiles = ["http://www.abc.com/hztxt.shx", "http://www.abc.com/simplex.shx"];

const viewer = new DxfViewer(viewerCfg);
await viewer.setFont(fontFiles);
await viewer.loadModelAsync(modelCfg, (event) => {
    const progress = (event.loaded * 100) / event.total;
    console.log(`${event.type}: ${progress}%`);
});
console.log("Loaded");
viewer.goToHomeView();

Features for DxfViewer

  • DxfViewer features includes: load and view one or more dxf files, basic mouse/key operations, layouts, layers, distance/area/angle measurements with osnaps, markups, hotpoints, comparison, undo/redo for measurements/markups, zoom to selected area, screenshots, set background color, etc.

  • Supported entity types includes: POINT, 3DFACE, ARC, ATTDEF, ATTRIB, CIRCLE, DIMENSION, MLEADER, MULTILEADER, ELLIPSE, HATCH, INSERT, LEADER, LINE, LWPOLYLINE, MTEXT, RAY, POLYLINE, SOLID, SPLINE, TEXT, VERTEX, VIEWPORT, XLINE, etc. IMAGE, OLE2FRAME, REGION are partially supported.

  • Load and view dxf file

  • Switch between layouts

  • Distance measurement

  • Area measurement

  • Angle measurement

  • Markups

  • Comparison

  • Undo/redo

DxfViewer limitations

  • It doesn’t support complex linetypes, e.g., linetype with text in it.
  • It uses line geometries to represent texts rather than mesh, for a better performance.
  • It doesn’t support polyline with different start and end width.
  • It doesn’t support Tangent CAD, need to export to T3 format first.
  • It supports dxf version “AutoCAD 2018”, other versions are not well tested.

How to integrate DxfViewer into your system

  • Physical structure diagram:
  • Logical structure diagram:

Features for BimViewer

  • Load and view BIM model
  • Orthographic view
  • Selection
  • X-Ray
  • Distance measurement
  • Section
  • Overlay 3d model with dxf
  • Explode

Features for VRViewer

  • Load and view a panorama
  • Switch to another panorama
  • Switch between decorations

评论

暂无评论