Daily update on 20251015-002614 by Nitload Youmu. Additional Message : Organize files of numerial math.
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
@@ -1,40 +1,38 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="TriangulatedSurface.cs"
|
||||
// file="TriangulatedSurface"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the “Software”), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
// and to permit persons to whom the Software is furnished to do so,
|
||||
// subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and
|
||||
// this permission notice shall be included in all copies
|
||||
// or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED “AS IS”,
|
||||
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH
|
||||
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
using StgSharp.HighPerformance;
|
||||
using StgSharp.Mathematics;
|
||||
using StgSharp.Mathematics.HighPrecision;
|
||||
using StgSharp.Mathematics.Graphic;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Intrinsics;
|
||||
using System.Text;
|
||||
@@ -61,6 +59,7 @@ namespace StgSharp.Geometries
|
||||
/**/
|
||||
public IEnumerable<List<int>> SideIndicesEnumeratble
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => _sideIndices ;
|
||||
}
|
||||
|
||||
@@ -78,11 +77,13 @@ namespace StgSharp.Geometries
|
||||
|
||||
public Span<Vec3> VertexSpan
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => CollectionsMarshal.AsSpan(_vertices);
|
||||
}
|
||||
|
||||
public Span<int> TriangleIndicesSpan
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => CollectionsMarshal.AsSpan(_triangleIndices);
|
||||
}
|
||||
|
||||
@@ -93,13 +94,13 @@ namespace StgSharp.Geometries
|
||||
_triangleIndices.Add(v2);
|
||||
_triangleIndices.Add(v3);
|
||||
if (!(_sides.Remove((v1,v2)) || _sides.Remove((v2, v1)))) {
|
||||
_sides.Add((v1, v2));
|
||||
_ = _sides.Add((v1, v2));
|
||||
}
|
||||
if (!(_sides.Remove((v2, v3)) || _sides.Remove((v3, v2)))) {
|
||||
_sides.Add((v2, v3));
|
||||
_ = _sides.Add((v2, v3));
|
||||
}
|
||||
if (!(_sides.Remove((v3, v1)) || _sides.Remove((v1, v3)))) {
|
||||
_sides.Add((v3, v1));
|
||||
_ = _sides.Add((v3, v1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ namespace StgSharp.Geometries
|
||||
_vertices.TrimExcess();
|
||||
Dictionary<int, int> side_dictionary = _sides.ToDictionary(x => x.begin, x => x.end);
|
||||
int begin = side_dictionary.First().Key;
|
||||
List<int> sideLoop = new List<int>(begin);
|
||||
List<int> sideLoop = new(begin);
|
||||
_sideIndices.Add(sideLoop);
|
||||
while (side_dictionary.Count > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user