Skip to content

Commit

Permalink
updating rhino3dm 8.0 samples
Browse files Browse the repository at this point in the history
  • Loading branch information
fraguada committed Nov 17, 2023
1 parent 630bcd7 commit fe284fb
Show file tree
Hide file tree
Showing 48 changed files with 177 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta2" />
<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion rhino3dm/cs/SampleCSExportObj/SampleCSExportObj.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta2" />
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion rhino3dm/cs/SampleCSJoinCurves/SampleCSJoinCurves.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta2" />
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions rhino3dm/cs/SampleCSPBRMaterial/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var sphere = new Rhino.Geometry.Sphere(Rhino.Geometry.Point3d.Origin, 10);
file3dm.Objects.AddSphere(sphere, oa);

//var rc = new Rhino.FileIO.File3dmRenderMaterial();

file3dm.Write("fileWithMaterial.3dm", null);


Expand Down
4 changes: 2 additions & 2 deletions rhino3dm/cs/SampleCSPBRMaterial/SampleCSPBRMaterial.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta3" />
<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion rhino3dm/cs/SampleCSReadFile/SampleCSReadFile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta2" />
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion rhino3dm/cs/SampleCSTestSetMesh/SampleCSTestSetMesh.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Rhino3dm" Version="8.0.0-beta3" />
<PackageReference Include="Rhino3dm" Version="8.0.1" />
</ItemGroup>

<Target Name="CopyCustomContent" AfterTargets="AfterBuild">
Expand Down
4 changes: 2 additions & 2 deletions rhino3dm/js/SampleCircles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ <h1>Fun with circles</h1>

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
9 changes: 4 additions & 5 deletions rhino3dm/js/SampleJSMakeBrep/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script id="imports" type="importmap">
{
"imports": {
"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/[email protected]/examples/jsm/controls/OrbitControls.js",
"rhino3dm":"https://unpkg.com/[email protected]/rhino3dm.module.min.js"

"three": "https://unpkg.com/[email protected]/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/[email protected]/examples/jsm/controls/OrbitControls.js",
"rhino3dm":"https://unpkg.com/[email protected]/rhino3dm.module.min.js"
}
}
</script>
Expand Down
4 changes: 3 additions & 1 deletion rhino3dm/js/SampleJSMakeBrep/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ doc.materials().add(magentaMaterial)

const magentaThreeMaterial = new THREE.MeshPhysicalMaterial( {color:0xff00ff, metalness:0.2, roughness: 0.9} )

console.log(doc.materials().count)

// #endregion MATERIALS //

// #region LAYERS //
Expand Down Expand Up @@ -230,7 +232,7 @@ function onWindowResize() {

function download() {
const options = new rhino.File3dmWriteOptions()
options.version = 7
options.version = 8
let buffer = doc.toByteArrayOptions(options)
saveByteArray('rhinoDocument_' + options.version + '.3dm', buffer)
}
Expand Down
10 changes: 5 additions & 5 deletions rhino3dm/js/SampleObjTo3dm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/OBJLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/OBJLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/OBJLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/OBJLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions rhino3dm/js/SampleObjectTypes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
10 changes: 5 additions & 5 deletions rhino3dm/js/SampleParse3dmObjects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/3DMLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/3DMLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
17 changes: 16 additions & 1 deletion rhino3dm/js/SampleParse3dmObjects/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ create()
function create () {

const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://unpkg.com/[email protected].0-beta2/' )
loader.setLibraryPath( 'https://unpkg.com/[email protected].1/' )

doc = new rhino.File3dm()

Expand Down Expand Up @@ -52,6 +52,21 @@ function create () {

const textdot_layer_index = doc.layers().addLayer( 'TextDots', { r: 0, g: 0, b: 255, a: 255 } )


// Create two groups

doc.groups().add(new rhino.Group())
doc.groups().add(new rhino.Group())
console.log(`nº of groups ${doc.groups().count}`)

const group1 = doc.groups().get(0)
console.log(`group id: ${group1.id}`)
console.log(`group index: ${group1.index}`)

const group2 = doc.groups().get(1)
console.log(`group id: ${group2.id}`)
console.log(`group index: ${group2.index}`)

// -- POINTS / POINTCLOUDS -- //

const oa_points = new rhino.ObjectAttributes()
Expand Down
4 changes: 2 additions & 2 deletions rhino3dm/js/SampleSketch2d/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
10 changes: 5 additions & 5 deletions rhino3dm/js/SampleUserStrings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/3DMLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].0-beta3/rhino3dm.module.min.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/3DMLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
4 changes: 3 additions & 1 deletion rhino3dm/js/SampleUserStrings/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ async function load() {

const rhinoObject = objs.get( i )

console.log(rhinoObject.geometry())

if ( rhinoObject.geometry().objectType === rhino.ObjectType.Curve ) continue

if ( rhinoObject.attributes().userStringCount > 0 ) {
Expand All @@ -59,7 +61,7 @@ async function load() {

// load and pass to threejs
const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://unpkg.com/[email protected].0-beta3/' )
loader.setLibraryPath( 'https://unpkg.com/[email protected].1/' )

loader.load( model, function ( object ) {

Expand Down
10 changes: 5 additions & 5 deletions rhino3dm/js/SampleViewer/01.1_basic_3dmLoader/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
<div id="loader"></div>
<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/3DMLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/3DMLoader.js",
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion rhino3dm/js/SampleViewer/01.1_basic_3dmLoader/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function init () {
function load() {

const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://unpkg.com/[email protected].0-beta2/' )
loader.setLibraryPath( 'https://unpkg.com/[email protected].1/' )

const material = new THREE.MeshNormalMaterial()
loader.load( model, function ( object ) {
Expand Down
8 changes: 4 additions & 4 deletions rhino3dm/js/SampleViewer/01.2_multipleFiles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/3DMLoader.js" }
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/3DMLoader.js" }
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion rhino3dm/js/SampleViewer/01.2_multipleFiles/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ select.onchange = load
let model = 'hello_mesh.3dm'

const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://unpkg.com/[email protected].0-beta2/' )
loader.setLibraryPath( 'https://unpkg.com/[email protected].1/' )

const material = new THREE.MeshNormalMaterial()

Expand Down
8 changes: 4 additions & 4 deletions rhino3dm/js/SampleViewer/01.3_uploadFiles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/3DMLoader.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/3DMLoader.js"
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion rhino3dm/js/SampleViewer/01.3_uploadFiles/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Rhino3dmLoader } from 'three/examples/jsm/loaders/3DMLoader'
// #region GLOBALS //

const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://unpkg.com/[email protected].0-beta2/' )
loader.setLibraryPath( 'https://unpkg.com/[email protected].1/' )

const upload = document.getElementById("file-upload")

Expand Down
8 changes: 4 additions & 4 deletions rhino3dm/js/SampleViewer/01_basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].2/dist/es-module-shims.js"></script>

<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"rhino3dm":"https://unpkg.com/[email protected].0-beta2/rhino3dm.module.min.js"
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"rhino3dm":"https://unpkg.com/[email protected].1/rhino3dm.module.min.js"
}
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions rhino3dm/js/SampleViewer/02_advanced/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@

<!-- Import maps polyfill -->
<!-- Remove this when import maps will be widely supported -->
<script async src="https://unpkg.com/[email protected].0/dist/es-module-shims.js"></script>
<script async src="https://unpkg.com/[email protected].1/dist/es-module-shims.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.157.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.157.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.157.0/examples/jsm/loaders/3DMLoader.js",
"three": "https://unpkg.com/three@0.158.0/build/three.module.js",
"three/examples/jsm/controls/OrbitControls": "https://unpkg.com/three@0.158.0/examples/jsm/controls/OrbitControls.js",
"three/examples/jsm/loaders/3DMLoader": "https://unpkg.com/three@0.158.0/examples/jsm/loaders/3DMLoader.js",
"dat.gui": "https://unpkg.com/[email protected]/build/dat.gui.module.js"
}
}
Expand Down
2 changes: 1 addition & 1 deletion rhino3dm/js/SampleViewer/02_advanced/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function load() {
material.envMap = scene.background

const loader = new Rhino3dmLoader()
loader.setLibraryPath( 'https://unpkg.com/[email protected].0-beta2/' )
loader.setLibraryPath( 'https://unpkg.com/[email protected].1/' )

// load 3dm file into three.js scene
loader.load( model, function ( object ) {
Expand Down
Loading

0 comments on commit fe284fb

Please sign in to comment.