From b7b0607dff0a8e8e2b979707544918afde778ba0 Mon Sep 17 00:00:00 2001 From: carlynorama Date: Fri, 22 Sep 2023 12:20:33 -0600 Subject: [PATCH] part 18 --- .../linked/03_cube_geom_corrected.usd | 1 + explorations/Part_18/hello_ring/ring_v1.txt | 44 ++++ .../Part_18/hello_ring/testsketch.txt | 73 ++++++ .../testsketch_20230725T085314.usda | 213 ++++++++++++++++++ .../hello_ring/testsketch_20230725T085314.x3d | 161 +++++++++++++ .../cube_base.usd} | 5 +- .../cube_base_with_purple_linked.usd | 29 +++ .../cube_base_with_purple_simple.usd | 37 +++ .../Sketching2023/cube_purple_animated.usd | 127 +++++++++++ explorations/Sketching2023/materials.usd | 21 ++ 10 files changed, 708 insertions(+), 3 deletions(-) create mode 100644 explorations/Part_18/hello_ring/ring_v1.txt create mode 100644 explorations/Part_18/hello_ring/testsketch.txt create mode 100644 explorations/Part_18/hello_ring/testsketch_20230725T085314.usda create mode 100644 explorations/Part_18/hello_ring/testsketch_20230725T085314.x3d rename explorations/{Part_06/sphere_base.usd => Sketching2023/cube_base.usd} (80%) create mode 100644 explorations/Sketching2023/cube_base_with_purple_linked.usd create mode 100644 explorations/Sketching2023/cube_base_with_purple_simple.usd create mode 100644 explorations/Sketching2023/cube_purple_animated.usd create mode 100644 explorations/Sketching2023/materials.usd diff --git a/explorations/Part_02/misc_scratch/linked/03_cube_geom_corrected.usd b/explorations/Part_02/misc_scratch/linked/03_cube_geom_corrected.usd index e30a285..112aa18 100644 --- a/explorations/Part_02/misc_scratch/linked/03_cube_geom_corrected.usd +++ b/explorations/Part_02/misc_scratch/linked/03_cube_geom_corrected.usd @@ -39,6 +39,7 @@ def Xform "Cube" } "green" { + over "cubeMesh" { rel material:binding = } diff --git a/explorations/Part_18/hello_ring/ring_v1.txt b/explorations/Part_18/hello_ring/ring_v1.txt new file mode 100644 index 0000000..878d689 --- /dev/null +++ b/explorations/Part_18/hello_ring/ring_v1.txt @@ -0,0 +1,44 @@ +// +// Ring.swift +// +// +// Created by Carlyn Maw on 7/25/23. +// + +import Foundation + +public struct Ring { + public init(count:Int, radius:Int) { + self.count = count + } + let count:Int + let minTranslate = -4.0 + let maxTranslate = 4.0 + let minRadius = 0.8 + let maxRadius = 2.0 + + let tau = Double.pi * 2 + + public func buildStage() -> Canvas3D { + let base_theta = tau/Double(count) + let color = 0.5 + return Canvas3D { + Sphere(radius: 1.0).color(red: 0.18, green: 0.18, blue: 0.18) + for i in 0.. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/explorations/Part_06/sphere_base.usd b/explorations/Sketching2023/cube_base.usd similarity index 80% rename from explorations/Part_06/sphere_base.usd rename to explorations/Sketching2023/cube_base.usd index f8902d1..b37d5e7 100644 --- a/explorations/Part_06/sphere_base.usd +++ b/explorations/Sketching2023/cube_base.usd @@ -11,10 +11,9 @@ def Xform "my_shape" double3 xformOp:translate = (0, 0, 0) uniform token[] xformOpOrder = ["xformOp:translate"] - def Sphere "sphere" + def Cube "cube" { float3[] extent = [(-2, -2, -2), (2, 2, 2)] - color3f[] primvars:displayColor = [(0, 0, 1)] double radius = 2 } -} \ No newline at end of file +} diff --git a/explorations/Sketching2023/cube_base_with_purple_linked.usd b/explorations/Sketching2023/cube_base_with_purple_linked.usd new file mode 100644 index 0000000..2a52e45 --- /dev/null +++ b/explorations/Sketching2023/cube_base_with_purple_linked.usd @@ -0,0 +1,29 @@ +#usda 1.0 +( + defaultPrim = "my_shape" + metersPerUnit = 1 + upAxis = "Y" + doc = "Base shape for amalgamation" +) + +def Xform "my_shape" +{ + def "Materials" ( + prepend references = @./materials.usd@ + ) + { + } + + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + + def Cube "cube" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding = + float3[] extent = [(-2, -2, -2), (2, 2, 2)] + double radius = 2 + } +} + diff --git a/explorations/Sketching2023/cube_base_with_purple_simple.usd b/explorations/Sketching2023/cube_base_with_purple_simple.usd new file mode 100644 index 0000000..4e38cf1 --- /dev/null +++ b/explorations/Sketching2023/cube_base_with_purple_simple.usd @@ -0,0 +1,37 @@ +#usda 1.0 +( + defaultPrim = "my_shape" + metersPerUnit = 1 + upAxis = "Y" + doc = "Base shape for amalgamation" +) + +def Xform "my_shape" +{ + + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + + def Cube "cube" ( + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding = + float3[] extent = [(-2, -2, -2), (2, 2, 2)] + double radius = 2 + } +} + +def Material "purple" +{ + token outputs:surface.connect = + + def Shader "previewShader" + { + uniform token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.9000001, 0.4429553, 0.72986294) + float inputs:metallic = 0.1 + float inputs:roughness = 0.9 + token outputs:surface + } +} \ No newline at end of file diff --git a/explorations/Sketching2023/cube_purple_animated.usd b/explorations/Sketching2023/cube_purple_animated.usd new file mode 100644 index 0000000..a594190 --- /dev/null +++ b/explorations/Sketching2023/cube_purple_animated.usd @@ -0,0 +1,127 @@ +#usda 1.0 +( + defaultPrim = "transformAnimation" + endTimeCode = 89 + startTimeCode = 0 + timeCodesPerSecond = 24 + upAxis = "Y" +) + +def Xform "transformAnimation" ( + assetInfo = { + asset identifier = @transformAnimation.usd@ + string name = "transformAnimation" + } + kind = "component" +) +{ + def Scope "Geom" + { + def Xform "xform1" + { + float xformOp:rotateY.timeSamples = { + 0: 0, + 1: 4, + 2: 8, + 3: 12, + 4: 16, + 5: 20, + 6: 24, + 7: 28, + 8: 32, + 9: 36, + 10: 40, + 11: 44, + 12: 48, + 13: 52, + 14: 56, + 15: 60, + 16: 64, + 17: 68, + 18: 72, + 19: 76, + 20: 80, + 21: 84, + 22: 88, + 23: 92, + 24: 96, + 25: 100, + 26: 104, + 27: 108, + 28: 112, + 29: 116, + 30: 120, + 31: 124, + 32: 128, + 33: 132, + 34: 136, + 35: 140, + 36: 144, + 37: 148, + 38: 152, + 39: 156, + 40: 160, + 41: 164, + 42: 168, + 43: 172, + 44: 176, + 45: 180, + 46: 184, + 47: 188, + 48: 192, + 49: 196, + 50: 200, + 51: 204, + 52: 208, + 53: 212, + 54: 216, + 55: 220, + 56: 224, + 57: 228, + 58: 232, + 59: 236, + 60: 240, + 61: 244, + 62: 248, + 63: 252, + 64: 256, + 65: 260, + 66: 264, + 67: 268, + 68: 272, + 69: 276, + 70: 280, + 71: 284, + 72: 288, + 73: 292, + 74: 296, + 75: 300, + 76: 304, + 77: 308, + 78: 312, + 79: 316, + 80: 320, + 81: 324, + 82: 328, + 83: 332, + 84: 336, + 85: 340, + 86: 344, + 87: 348, + 88: 352, + 89: 356, + } + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateY"] + + over "cube_1" ( + prepend references = @./cube_base_with_purple_linked.usd@ + ) + { + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate"] + } + } + } +} + diff --git a/explorations/Sketching2023/materials.usd b/explorations/Sketching2023/materials.usd new file mode 100644 index 0000000..b00e00e --- /dev/null +++ b/explorations/Sketching2023/materials.usd @@ -0,0 +1,21 @@ +#usda 1.0 +( + defaultPrim = "_materials" +) + +def Scope "_materials" +{ + def Material "purple" + { + token outputs:surface.connect = + + def Shader "previewShader" + { + uniform token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (0.9000001, 0.4429553, 0.72986294) + float inputs:metallic = 0.1 + float inputs:roughness = 0.9 + token outputs:surface + } + } +} \ No newline at end of file