# magiz **Repository Path**: zhou_shi_hu/magiz ## Basic Information - **Project Name**: magiz - **Description**: 生成轻量化建筑模型 For Generating Lightweight Building Models - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: https://charlesooo.github.io/magiz/examples - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2024-05-22 - **Last Updated**: 2025-09-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: magiz ## README # Magiz 在 web 端生成轻量化的建筑模型,主要特点如下: - 从任意平面轮廓生成建筑模型 - 可仅用方块生成模型以提升大场景的渲染效率 To generate lightweight building model on the web side. The main features are as follows: - Generate architectural models from arbitrary plan profiles - Models can be generated with only blocks to improve the rendering efficiency of large scenes ## Notice **Functions may change in the future.** ## Demo play with [example](./examples/index.html) or [demo](https://charlesooo.github.io/magiz-demo/) ## Basic Usage ```bash npm i ``` First install dependencies. ```bash npm run build ``` Bundle TS to ESM (`dist\magiz.module.min.js`). Localhost [example/index.html](./example/index.html) to see demo. this page can be the start point of creating new styles. Refer to [src/types](./src/types) for tips and type details. To develop with ViewClass, which is a custom three.js environment, use `npm run dev_` or `npm run build_` instead. ## Main Feature To enable block only generation mode, set match to a none zero block size. ```ts const plan = new Plan({ match: 2 }) ``` This will only use block combinations for buildings and can be presented as 'instancedMesh' in Three.js to render all models in one drawCall. ## Custom Styles - ### Files related [src/types/styleTypes.d.ts](./src/types/styleTypes.d.ts) contains tips and type details for styles. [src/styles](./src/styles) contains style examples. - ### Steps 1. Start watching files. Any changes will be bundled into `dist\magiz.module.min.js` ```bash npm run dev ``` 2. Localhost `example/index.html` Recommend to init with [VSC](https://code.visualstudio.com/) and [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) extension. 3. Edit `src\styles\preset.ts` to create your presets Preset are style chunks can be reused in styles. `src/class/styleClass/utils` provide **'check'** functions to offer type checking and param tips. 4. Edit `src\styles\simple.ts` to create your styles `src/class/styleClass/utils` provide **'preset'** functions to import style chunks from `src\styles\preset.ts` and offer type checking and param tips. ## Need More Styles If someone creates a new style and is interested in contributing, please PR to establish a public awesome style library. ## License [GPLv3](./LICENSE) ## Misc Any opinions and suggestions are welcomed ! 周 曦 <453154007@qq.com> Wechat: Ketchup