mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-25 20:08:28 +00:00
Added HulledObject, Hull
This commit is contained in:
parent
81b49cf994
commit
ae3f9e4d2f
@ -15,7 +15,7 @@ namespace OSCADSharp.ConsoleTests
|
|||||||
{
|
{
|
||||||
var cube = new Cube(null, true).Translate(10, 0, 5).Scale(1, 1, 5);
|
var cube = new Cube(null, true).Translate(10, 0, 5).Scale(1, 1, 5);
|
||||||
var sphere = new Sphere().Mimic(cube).Translate(0, 0, 10);
|
var sphere = new Sphere().Mimic(cube).Translate(0, 0, 10);
|
||||||
string script = cube.Minkowski(sphere, new Cylinder()).ToString();
|
string script = cube.Hull(sphere, new Cylinder()).ToString();
|
||||||
|
|
||||||
File.WriteAllLines("test.scad", new string[] { script.ToString() });
|
File.WriteAllLines("test.scad", new string[] { script.ToString() });
|
||||||
Console.ReadKey();
|
Console.ReadKey();
|
||||||
|
|||||||
@ -143,6 +143,16 @@ namespace OSCADSharp
|
|||||||
{
|
{
|
||||||
return new MinkowskiedObject(nodes);
|
return new MinkowskiedObject(nodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a conved hull from child nodes (including this object)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="nodes">Nodes to hull</param>
|
||||||
|
/// <returns>Hull of nodes</returns>
|
||||||
|
public OSCADObject Hull(params OSCADObject[] nodes)
|
||||||
|
{
|
||||||
|
return new HulledObject(nodes);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Boolean Operations
|
#region Boolean Operations
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Sizes.cs" />
|
<Compile Include="Sizes.cs" />
|
||||||
|
<Compile Include="Transforms\HulledObject.cs" />
|
||||||
<Compile Include="Transforms\IMimicer.cs" />
|
<Compile Include="Transforms\IMimicer.cs" />
|
||||||
<Compile Include="Transforms\LinearExtrudedObject.cs" />
|
<Compile Include="Transforms\LinearExtrudedObject.cs" />
|
||||||
<Compile Include="Scripting\SingleBlockFormatter.cs" />
|
<Compile Include="Scripting\SingleBlockFormatter.cs" />
|
||||||
|
|||||||
19
OSCADSharp/OSCADSharp/Transforms/HulledObject.cs
Normal file
19
OSCADSharp/OSCADSharp/Transforms/HulledObject.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using OSCADSharp.Scripting;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OSCADSharp.Transforms
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Creates an object that's the convex hull of child objects
|
||||||
|
/// </summary>
|
||||||
|
internal class HulledObject : MultiBlockStatementObject
|
||||||
|
{
|
||||||
|
public HulledObject(IEnumerable<OSCADObject> children) : base("hull()", children)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user