12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <div>
- <canvas id="wall" width="800" height="400" tabindex="0" />
- </div>
- </template>
- <script>
- import {SGraphScene, SGraphView} from "@persagy-web/graph/";
- import {SZoneItem} from "@persagy-web/big/lib/items/floor/ZoneItem";
- export default {
- name: "zone",
- data(){
- return {
- outline:[
- [
- // 未掏洞的空间
- [
- {"X":30150.15,"Y":82300.04,"Z":59400.0},
- {"X":30150.15,"Y":81400.04,"Z":59400.0},
- {"X":33400.15,"Y":82300.04,"Z":59400.0},
- {"X":30150.15,"Y":82300.04,"Z":59400.0}
- ],
- ],
- [
- // 掏洞的空间
- [
- {"X":25500.15,"Y":77100.04,"Z":59400.0},
- {"X":28200.15,"Y":77100.04,"Z":59400.0},
- {"X":28200.15,"Y":82300.04,"Z":59400.0},
- {"X":25500.15,"Y":82300.04,"Z":59400.0},
- {"X":25500.15,"Y":77100.04,"Z":59400.0}
- ],
- [
- {"X":25900.15,"Y":80300.04,"Z":59400.0},
- {"X":27200.15,"Y":80300.04,"Z":59400.0},
- {"X":27200.15,"Y":77900.04,"Z":59400.0},
- {"X":25900.15,"Y":77900.04,"Z":59400.0},
- ]
- ]
- ]
- }
- },
- mounted() {
- this.init();
- },
- methods:{
- init(){
- this.view = new SGraphView('wall');
- const scene = new SGraphScene();
- this.view.scene = scene;
- // 只模拟了轮廓数据
- const item = new SZoneItem(null,{OutLine:this.outline});
- scene.addItem(item);
- this.view.fitSceneToView();
- this.view.scalable = false;
- }
- }
- }
- </script>
- <style scoped>
- </style>
|