{"id":20239382,"url":"https://github.com/opensourcebim/bimsurfer-before2019","last_synced_at":"2025-05-15T11:03:28.257Z","repository":{"id":140671478,"uuid":"2172851","full_name":"opensourceBIM/BIMsurfer-before2019","owner":"opensourceBIM","description":"This is the repository of the v1 and v2 version of BIM Surfer. It is not maintained anymore. Find the most recent version on https://github.com/opensourceBIM/BIMsurfer","archived":false,"fork":false,"pushed_at":"2024-10-21T19:54:34.000Z","size":67658,"stargazers_count":432,"open_issues_count":86,"forks_count":195,"subscribers_count":92,"default_branch":"master","last_synced_at":"2025-04-07T09:09:42.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opensourceBIM.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-08-08T11:14:51.000Z","updated_at":"2024-09-15T06:56:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb8f5639-c8ad-4577-af6c-c2e0685acbd7","html_url":"https://github.com/opensourceBIM/BIMsurfer-before2019","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMsurfer-before2019","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMsurfer-before2019/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMsurfer-before2019/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceBIM%2FBIMsurfer-before2019/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensourceBIM","download_url":"https://codeload.github.com/opensourceBIM/BIMsurfer-before2019/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248912320,"owners_count":21182250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T08:38:40.113Z","updated_at":"2025-04-14T15:55:09.629Z","avatar_url":"https://github.com/opensourceBIM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n    Copyright 2018, bimsurfer.org\n    BIM Surfer is licensed under the MIT License.\n\n# Outdated\n\nThis repo holds the BIM Surfer v1 and v2. This codebase is not maintained anymore. Find the new BIM Surfer on https://github.com/opensourceBIM/BIMsurfer\n\n\n# Table of Contents\n\n- [Introduction](#introduction)\n- [Usage](#usage)\n  - [BIMSurfer](#bimsurfer)\n  - [Objects](#objects)\n    - [Selecting and deselecting objects](#selecting-and-deselecting-objects)\n    - [Showing and hiding objects](#showing-and-hiding-objects)\n    - [Changing color and transparency of objects](#changing-color-and-transparency-of-objects)\n  - [Camera](#camera)\n    - [Controlling the camera](#controlling-the-camera)\n    - [Fitting objects in view](#fitting-objects-in-view)\n  - [Resetting](#resetting)\n    - [Camera](#camera-1)\n    - [Objects](#objects-1)\n\n# Introduction\n\nBIMSurfer is a WebGL-based 3D viewer for [BIMServer]() that's built on [xeogl](https://github.com/xeolabs/xeogl).\n \nTODO: More info\n     \n# Usage\n\n## BIMSurfer\n\nCreating a [BIMSurfer](bimsurfer/src/BimSurfer.js): \n\n````javascript\nvar bimSurfer = new BimSurfer({\n    domNode: \"viewerContainer\"\n});\n````\n\nLoading a model from BIMServer:\n \n````javascript\nbimSurfer.load({\n        bimserver: ADDRESS,\n        username: USERNAME,\n        password: PASSWORD,\n        poid: 131073,\n        roid: 65539,\n        schema: \"ifc2x3tc1\" // \u003c TODO: Deduce automatically\n    })\n        .then(function (model) {\n        \n                // Model is now loaded and rendering.\n                // The following sections show what you can do with BIMSurfer at this point.\n                //...\n            });\n````\n\nGenerate a random test model if you want to test BIMSurfer without loading anything from BIMServer:   \n\n````javascript\nbimSurfer.loadRandom();\n````\n\nThe following usage examples in this guide will refer to objects from the generated test model.\n\n## Objects\n\n### Selecting and deselecting objects\n\nSelecting four objects:\n\n````javascript\nbimSurfer.setSelection({ids: [\"object3\", \"object2\", \"object4\", \"object6\"], selected: true });\n````\n\nthen querying which objects are selected:\n\n````javascript\nbimSurfer.getSelection()\n````\n\nThe result shows that those four objects are currently selected:\n\n````json\n[\"object3\", \"object2\", \"object4\", \"object6\"]\n````\n\nIf we then deselect two objects, then query the selection again:\n\n````javascript\nbimSurfer.setSelection({ids: [\"object3\", \"object6\"], selected: false });\nbimSurfer.getSelection()\n````\n\nThe result shows that only two objects are now selected:\n\n````json\n[\"object2\", \"object4\"]  \n````\n\nSubscribing to selection updates:\n\n````javascript\nbimSurfer.on(\"selection-changed\", \n    function() {\n         var selected = bimSurfer.getSelection();\n         console.log(\"selection = \" + JSON.stringify(selected));\n    });\n````\n\n### Showing and hiding objects\n\nHiding three objects by ID:\n\n````javascript\nbimSurfer.setVisibility({ids: [\"object3\", \"object1\", \"object6\"], visible: false });\n````\n\nSetting two objects visible by ID:\n\n````javascript\nbimSurfer.setVisibility({ids: [\"object1\", \"object6\"], visible: true });\n````\n\nHiding all objects of IFC types \"IfcSlab\" and \"IfcWall\":\n\n````javascript\nbimSurfer.setVisibility({types: [\"IfcSlab\", \"IfcWall\"], visible: false });\n````\n\n### Changing color and transparency of objects\n\nMaking two objects pink:\n\n````javascript\nbimSurfer.setColor({ids: [\"object3\", \"object6\"], color: [1, 0, 1] })\n````\n\nAn optional fourth element may be specified in the color to set opacity: \n\n````javascript\nbimSurfer.setColor({ids: [\"object3\", \"object6\"], color: [1, 0, 1, 0.5] })\n````\n\n## Camera\n  \n### Controlling the camera\n\nSetting the camera position:\n\n````javascript\nbimSurfer.setCamera({ \n    eye: [-20,0,20],\n    target: [0,10,0],\n    up: [0,1,0]\n});\n````\n\nThen \"target\" will then be the position we'll orbit about with the mouse or arrow keys (until we double-click an object to \n select a different orbit position).\n\nSetting the camera projection to orthographic:\n\n````javascript\nbimSurfer.setCamera({ \n    type:\"ortho\"\n});\n````\n\nSetting the view volume size for orthographic, switching to orthographic projection first if necessary:\n\n````javascript\nbimSurfer.setCamera({ \n    type:\"ortho\", \n    scale: 100\n});\n````\nThis uses the same technique as Blender, where the scale argument relates to the \"real world\" size of the model, meaning \nthat if you set scale to 100, then your view would at most encompass an element of 100 units size.    \n\nSetting the camera projection to perspective:\n\n````javascript\nbimSurfer.setCamera({ \n    type:\"persp\"\n});\n````\n\nSetting the FOV on Y-axis for perspective, switching to perspective projection first if necessary:\n\n````javascript\nbimSurfer.setCamera({ \n    type:\"persp\", \n    fovy: 65\n});\n````\n\nQuerying camera state:\n\n````javascript\nvar camera = bimSurfer.getCamera();\n````\n\nThe returned value would be:\n\n````json\n{\n    \"type\": \"persp\",\n    \"eye\": [-20,0,20],\n    \"target\": [0,10,0],\n    \"up\": [0,1,0],\n    \"fovy\": 65\n}\n````\n\nSubscribing to camera updates:\n\n````javascript\nbimSurfer.on(\"camera-changed\", \n    function() {\n         var camera = bimSurfer.getCamera();\n         console.log(JSON.stringify(camera));\n    });\n````\n \n### Fitting objects in view\n\nFlying the camera to fit the specified objects in view:\n\n````javascript\nbimSurfer.viewFit({ ids: [\"object3\", \"object1\", \"object6\"], animate: true });\n````\n\nJumping the camera to fit the specified objects in view:\n\n````javascript\nbimSurfer.viewFit({ids: [\"object1\", \"object6\"], animate: false });\n````\n\nFlying to fit all objects in view:\n\n````javascript\nbimSurfer.viewFit({ animate: true });\n````\n\nJumping to fit all objects in view:\n\n````javascript\nbimSurfer.viewFit({ animate: false });\n````\n\n## Resetting\n\n### Camera\n\nResetting the camera to initial position:  \n\n````javascript\nbimSurfer.reset({ cameraPosition: true });\n````\n\n### Objects\n\nResetting all objects to initial visibilities:\n\n````javascript\nbimSurfer.reset({ visibility: true });\n````\n\nResetting two objects to their initial visibilities:  \n\n````javascript\nbimSurfer.reset({ ids: [\"object3\", \"object6\"], visibility: true });\n````\n\nResetting all objects to their initial colors:  \n\n````javascript\nbimSurfer.reset({ elementColors: true });\n````\n\nResetting two objects to their initial colors:  \n\n````javascript\nbimSurfer.reset({ ids: [\"object3\", \"object6\"], elementColors: true });\n````\n\nDeselecting all objects:  \n\n````javascript\nbimSurfer.reset({ selectionState: true });\n````\n\n \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourcebim%2Fbimsurfer-before2019","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensourcebim%2Fbimsurfer-before2019","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourcebim%2Fbimsurfer-before2019/lists"}