Skip to content

Commit

Permalink
Split into separate library and plugin projects. RhinoCAM to Robots c…
Browse files Browse the repository at this point in the history
…omponent.
  • Loading branch information
visose committed Apr 8, 2019
1 parent 92f75c8 commit 32c38bb
Show file tree
Hide file tree
Showing 84 changed files with 697 additions and 363 deletions.
18 changes: 15 additions & 3 deletions Extensions.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.14
# Visual Studio Version 16
VisualStudioVersion = 16.0.28729.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extensions", "Extensions\Extensions.csproj", "{66D4E86F-EC84-40C9-8E32-8CF8875C3FEB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExtensionsGH", "ExtensionsGH\ExtensionsGH.csproj", "{66D4E86F-EC84-40C9-8E32-8CF8875C3FEB}"
ProjectSection(ProjectDependencies) = postProject
{3725F498-9DF7-42FC-B0B6-B8575E92C52D} = {3725F498-9DF7-42FC-B0B6-B8575E92C52D}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Extensions", "Extensions\Extensions.csproj", "{3725F498-9DF7-42FC-B0B6-B8575E92C52D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -15,8 +20,15 @@ Global
{66D4E86F-EC84-40C9-8E32-8CF8875C3FEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66D4E86F-EC84-40C9-8E32-8CF8875C3FEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66D4E86F-EC84-40C9-8E32-8CF8875C3FEB}.Release|Any CPU.Build.0 = Release|Any CPU
{3725F498-9DF7-42FC-B0B6-B8575E92C52D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3725F498-9DF7-42FC-B0B6-B8575E92C52D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3725F498-9DF7-42FC-B0B6-B8575E92C52D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3725F498-9DF7-42FC-B0B6-B8575E92C52D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {47E98D13-A3D0-43ED-B9EF-39DC38D9B1E6}
EndGlobalSection
EndGlobal
48 changes: 9 additions & 39 deletions Extensions/Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>C:\Users\vicen\AppData\Roaming\Grasshopper\Libraries</OutputPath>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>bin\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>C:\Users\vicen\AppData\Roaming\Grasshopper\Libraries</OutputPath>
<OutputPath>bin\</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Costura.Fody" Version="3.3.3" />
<PackageReference Include="Grasshopper" Version="6.13.19058.371" />
<PackageReference Include="Grasshopper" Version="6.11.18344.20091" />
<PackageReference Include="morelinq" Version="3.1.0" />
<PackageReference Include="RhinoCommon" Version="6.11.18344.20091" />
</ItemGroup>

<ItemGroup>
<ItemGroup>
<Reference Include="geometry3">
<HintPath>..\..\gsGCode\bin\Release\geometry3.dll</HintPath>
</Reference>
Expand All @@ -31,41 +31,11 @@
<Reference Include="Robots">
<HintPath>..\..\..\..\AppData\Roaming\Grasshopper\Libraries\Robots.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="RobotsGH">
<HintPath>..\..\..\..\AppData\Roaming\Grasshopper\Libraries\Robots.gha</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="StraightSkeletonNet">
<HintPath>Resources\StraightSkeletonNet.dll</HintPath>
<HintPath>Libraries\StraightSkeletonNet.dll</HintPath>
<Private>true</Private>
</Reference>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="Copy &quot;$(TargetPath)&quot; &quot;$(TargetDir)$(ProjectName).gha&quot;&#xD;&#xA;Erase &quot;$(TargetPath)&quot;" />
</Target>

<Target Name="PreventCopyLocal" AfterTargets="ResolveReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'Grasshopper'" />
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == 'RhinoCommon'" />
</ItemGroup>
</Target>

</Project>
70 changes: 0 additions & 70 deletions Extensions/Extensions.ruleset

This file was deleted.

36 changes: 16 additions & 20 deletions Extensions/Model/Discrete/VoxelTiles.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Extensions.Model.Spatial;
using MoreLinq;
using Rhino.Geometry;
using Rhino.Geometry.Intersect;
using MoreLinq;
using Extensions.Model.Spatial;
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static Extensions.Model.Util;
using static System.Math;

namespace Extensions.Model.Discrete
{
internal class VoxelTiles
public class VoxelTiles
{
static Vector3d[] _faceNormals;
static Vector3d[] _edgeNormals;
static Vector3d[] _cornerNormals;
static readonly Vector3d[] _faceNormals;
static readonly Vector3d[] _edgeNormals;
static readonly Vector3d[] _cornerNormals;

static VoxelTiles()
{
Expand Down Expand Up @@ -55,9 +55,8 @@ public static IList<Voxel> Create(Mesh boundary, double length, List<Curve> alig
internal Vector3i Size;
internal double VoxelSize;
internal Point3d Corner;

int _count;
int[] _typesCount;
//readonly int _count;
readonly int[] _typesCount;

internal VoxelTiles(Mesh boundary, double length, List<Curve> alignments, double alignmentDistance, List<GeometryBase> attractors, double attractorDistance, int[] typesCount)
{
Expand All @@ -68,7 +67,7 @@ internal VoxelTiles(Mesh boundary, double length, List<Curve> alignments, double

var sizef = bbox.Diagonal / length;
Size = new Vector3i((int)sizef.X, (int)sizef.Y, (int)sizef.Z);
_count = Size.X * Size.Y * Size.Z;
//_count = Size.X * Size.Y * Size.Z;
sizef = new Vector3d(Size.X, Size.Y, Size.Z);
Corner = bbox.Min + (bbox.Diagonal - sizef * length) * 0.5f;

Expand Down Expand Up @@ -172,9 +171,7 @@ void SetAlignmentsClosest(IEnumerable<Curve> curves)
var tangent = minCurve.TangentAt(minT);
var curvature = minCurve.CurvatureAt(minT);
var normal = Vector3d.CrossProduct(tangent, curvature);
var snapPlane = SnapPlane(voxel, normal, tangent);
voxel.Location = snapPlane.plane;
voxel.SnapType = snapPlane.snapType;
(voxel.Location, voxel.SnapType) = SnapPlane(voxel, normal, tangent);
}
}

Expand Down Expand Up @@ -276,21 +273,20 @@ IEnumerable<Voxel> GetVoxels()
}
}

internal class Voxel
public class Voxel
{
public Vector3i Index;
public Plane Location;
public bool IsActive;
public int Type;
public double AttractorDistance;
public int SnapType;

//public GeometryBase Geometry;

VoxelTiles _grid;

public Voxel(Vector3i index, VoxelTiles grid)
{
_grid = grid;
Index = index;
Location = Plane.WorldXY;
Location.Origin = grid.Corner + new Vector3d(index.X + 0.5f, index.Y + 0.5f, index.Z + 0.5f) * grid.VoxelSize;
Expand Down
1 change: 0 additions & 1 deletion Extensions/Model/Document/DisplayGeometry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

namespace Extensions.Model.Document
{

public class DisplayGeometry
{
public GeometryBase Geometry { get; set; }
Expand Down
Loading

0 comments on commit 32c38bb

Please sign in to comment.