Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisdial committed May 6, 2024
2 parents fbaaf61 + 26bd8bb commit 28429da
Show file tree
Hide file tree
Showing 20 changed files with 539 additions and 53 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ManualBuildOnly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x
dotnet-quality: 'ga'
- name: Restore dependencies
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ManualBuildWithNuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x
dotnet-quality: 'ga'
- name: Restore dependencies
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/OnPublishedRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x
dotnet-quality: 'ga'
- name: Restore dependencies
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/OnPushDevelop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x
dotnet-quality: 'ga'
- name: Restore dependencies
run: |
Expand Down
132 changes: 132 additions & 0 deletions src/L3D.Net.Tests/ExamplesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,4 +1288,136 @@ public static Luminaire BuildExample008(this Luminaire luminaire)

return Resolver.Resolve(luminaire, cache)!;
}

public static Luminaire BuildExample009(this Luminaire luminaire)
{
var exampleDirectory = Path.Combine(Setup.ExamplesDirectory, "example_009");
var cubeObjPath = Path.Combine(exampleDirectory, "cube", "textured_cube.obj");
var cache = exampleDirectory.ToCache();
var fileName = Path.GetFileName(cubeObjPath);

luminaire.Header = new Header
{
CreatedWithApplication = "Example-Tool"
};

var baseDefinition = new GeometryFileDefinition
{
GeometryId = "cube",
Units = GeometricUnits.m,
Model = ObjParser.Parse(fileName, cache.Geometries["cube"], NullLogger.Instance),
FileName = fileName
};

luminaire.GeometryDefinitions = new List<GeometryFileDefinition>
{
baseDefinition
};

luminaire.Parts = new List<GeometryPart>
{
new()
{
Name = "luminaire",
GeometryReference = baseDefinition,
LightEmittingObjects = new List<LightEmittingPart>
{
new(new Rectangle
{
SizeX = 0.5,
SizeY = 0.25
})
{
Name = "leo"
}
},
LightEmittingSurfaces = new List<LightEmittingSurfacePart>
{
new()
{
Name = "les",
FaceAssignments = new List<FaceAssignment>
{
new SingleFaceAssignment
{
FaceIndex = 3
}
},
LightEmittingPartIntensityMapping = new Dictionary<string, double>
{
["leo"] = 1
}
}
}
}
};

return Resolver.Resolve(luminaire, cache)!;
}

public static Luminaire BuildExample010(this Luminaire luminaire)
{
var exampleDirectory = Path.Combine(Setup.ExamplesDirectory, "example_010");
var cubeObjPath = Path.Combine(exampleDirectory, "cube", "textured_cube.obj");
var cache = exampleDirectory.ToCache();
var fileName = Path.GetFileName(cubeObjPath);

luminaire.Header = new Header
{
CreatedWithApplication = "Example-Tool"
};

var baseDefinition = new GeometryFileDefinition
{
GeometryId = "cube",
Units = GeometricUnits.m,
Model = ObjParser.Parse(fileName, cache.Geometries["cube"], NullLogger.Instance),
FileName = fileName
};

luminaire.GeometryDefinitions = new List<GeometryFileDefinition>
{
baseDefinition
};

luminaire.Parts = new List<GeometryPart>
{
new()
{
Name = "luminaire",
GeometryReference = baseDefinition,
LightEmittingObjects = new List<LightEmittingPart>
{
new(new Rectangle
{
SizeX = 0.5,
SizeY = 0.25
})
{
Name = "leo"
}
},
LightEmittingSurfaces = new List<LightEmittingSurfacePart>
{
new()
{
Name = "les",
FaceAssignments = new List<FaceAssignment>
{
new SingleFaceAssignment
{
FaceIndex = 3
}
},
LightEmittingPartIntensityMapping = new Dictionary<string, double>
{
["leo"] = 1
}
}
}
}
};

return Resolver.Resolve(luminaire, cache)!;
}
}
27 changes: 21 additions & 6 deletions src/L3D.Net.Tests/L3D.Net.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<LangVersion>10</LangVersion>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -25,4 +25,19 @@
</None>
</ItemGroup>

<ItemGroup>
<None Update="TestData\xml\v0.11.0\example_009\cube\CubeTexture.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\xml\v0.11.0\example_009\cube\textured_cube.mtl">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\xml\v0.11.0\example_009\cube\textured_cube.obj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\xml\v0.11.0\example_009\structure.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit 28429da

Please sign in to comment.