From 62ae7918ed0b19b3ea5473bcf61a8c611dc19a8f Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Mon, 23 Aug 2021 15:26:34 -0700 Subject: [PATCH] Add simpler aliases for attribute tables --- README.md | 3 +++ init.lua | 22 +++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9340828..5341abb 100644 --- a/README.md +++ b/README.md @@ -44,16 +44,19 @@ simple_models.cube_1x2x1: - fields: - mesh: "simple_models_cube_1x2x1.obj" - box: {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5} +- alias: simple_models.cube simple_models.panel_1x2x1: - fields: - mesh: "simple_models_panel_1x2x1.obj" - box: {-0.5, -0.5, -0.5, 0.5, 1.5, -0.45} +- alias: simple_models.panel simple_models.panel_rear_1x2x1: - fields: - mesh: "simple_models_panel_rear_1x2x1.obj" - box: {-0.5, -0.5, 0.45, 0.5, 1.5, 0.5} +- alias: simple_models.panel_rear ``` ### Licensing diff --git a/init.lua b/init.lua index 3306c56..7e32fde 100644 --- a/init.lua +++ b/init.lua @@ -8,7 +8,11 @@ -- -- @table simple_models simple_models = { - --- @table simple_models.cube_1x2x1 + --- Cube + -- + -- Alias: simple_models.cube + -- + -- @table simple_models.cube_1x2x1 -- @tfield string mesh simple_models_cube_1x2x1.obj -- @tfield table box {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5} cube_1x2x1 = { @@ -16,7 +20,11 @@ simple_models = { box = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5}, }, - --- @table simple_models.panel_1x2x1 + --- Panel + -- + -- Alias: simple_models.panel + -- + -- @table simple_models.panel_1x2x1 -- @tfield string mesh simple_models_panel_1x2x1.obj -- @tfield table box {-0.5, -0.5, -0.5, 0.5, 1.5, -0.45} panel_1x2x1 = { @@ -24,7 +32,11 @@ simple_models = { box = {-0.5, -0.5, -0.5, 0.5, 1.5, -0.45}, }, - --- @table simple_models.panel_rear_1x2x1 + --- Rear panel + -- + -- Alias: simple_models.panel_rear + -- + -- @table simple_models.panel_rear_1x2x1 -- @tfield string mesh simple_models_panel_rear_1x2x1.obj -- @tfield table box {-0.5, -0.5, 0.45, 0.5, 1.5, 0.5} panel_rear_1x2x1 = { @@ -33,6 +45,10 @@ simple_models = { }, } +simple_models.cube = simple_models.cube_1x2x1 +simple_models.panel = simple_models.panel_1x2x1 +simple_models.panel_rear = simple_models.panel_rear_1x2x1 + --- Global table. -- -- Alias of `simple_models`