Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revit receive first pass: reference geometry workflow (CNX-403) #254

Merged
merged 37 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
54a3a45
feat(dui3): re-enables receive binding
didimitrie Sep 9, 2024
0af84a8
chore(revit): drastic cleanup
didimitrie Sep 9, 2024
bdbb20e
feat(revit): starts scaffolding revit root to host converter
didimitrie Sep 9, 2024
24f86ce
RenderMaterialToHostConverter added back
kekesidavid Sep 10, 2024
a4abd26
casting to GeometryObject instead of GeometryElement
kekesidavid Sep 10, 2024
8f84a9e
feat(dui3): fallback display values and refactors out material converter
didimitrie Sep 10, 2024
807d9ff
feat(dui3): creates DS and adds point support
didimitrie Sep 10, 2024
05f30e3
feat(dui3): closed nurbs fallback to display values
didimitrie Sep 10, 2024
cfb20de
David/cnx 443 selection (#231)
kekesidavid Sep 10, 2024
7f1e00e
wip
kekesidavid Sep 12, 2024
71f857f
Merge branch 'dev' into grouping-sandbox
didimitrie Sep 12, 2024
9823cec
feat(revit): wraps receive in correct context
didimitrie Sep 12, 2024
92bbddb
wip
didimitrie Sep 12, 2024
5d8d572
feat(dui3): adds prototype grouping by collection
didimitrie Sep 12, 2024
18c8d44
remove invalid characters from group name
kekesidavid Sep 12, 2024
7ce34d6
hide warnings preprocessor
kekesidavid Sep 12, 2024
38ed784
exception handling and error log
kekesidavid Sep 12, 2024
e1b0832
added cancellation and progress reporting
kekesidavid Sep 12, 2024
81f35f6
chore: comments and minor cleanup
didimitrie Sep 12, 2024
0cc0897
Merge pull request #237 from specklesystems/grouping-sandbox
didimitrie Sep 12, 2024
0e87060
David/cnx 409 2 add rendermaterial and color manager to connector (#242)
kekesidavid Sep 16, 2024
e77b2e4
Minor cleanup
oguzhankoral Sep 16, 2024
10d0988
Add object application id into objects of its layer render material p…
oguzhankoral Sep 16, 2024
90834bd
feat(dui3): adds compatibility for objects with display values
didimitrie Sep 16, 2024
1de58a3
Merge pull request #243 from specklesystems/oguzhan/cnx-470-add-suppo…
didimitrie Sep 16, 2024
57407d4
Use LocalToGlobal logic for revit receive
oguzhankoral Sep 16, 2024
e1053df
Use common local to global util for arcgis too
oguzhankoral Sep 16, 2024
206524a
Remove unnecessary registration
oguzhankoral Sep 16, 2024
70e43dd
Remove using
oguzhankoral Sep 16, 2024
4e523ac
Remove unnecessart ToList
oguzhankoral Sep 16, 2024
b8b9355
Register LocalToGlobalConverterUtils for connectors not as common
oguzhankoral Sep 17, 2024
f74f9bc
Merge pull request #244 from specklesystems/oguzhan/cnx-442-handle-in…
didimitrie Sep 17, 2024
5caf403
purge materials and groups in Revit before update (#245)
kekesidavid Sep 18, 2024
5e52cdd
assign categories to DirectShapes after receive, updated revit invali…
kekesidavid Sep 18, 2024
2fa3477
Merge remote-tracking branch 'origin/dev' into revit-receive
oguzhankoral Sep 19, 2024
dc394fa
Post conflict resolving problems
oguzhankoral Sep 19, 2024
7a42a10
minor changes, logging, comments (#257)
kekesidavid Sep 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore(revit): drastic cleanup
maybe too drastic, we will see soon
  • Loading branch information
didimitrie committed Sep 9, 2024
commit 0af84a8b27ae71377232306194a26c8ed2f5a066
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\EllipseConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\ICurveConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\LineConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\MeshConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\PlaneConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\PointConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\PolylineConverterToHost.cs" />
Expand All @@ -47,16 +48,6 @@
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\ToDirectShape\PolycurveConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\ToDirectShape\PolylineConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\Geometry\VectorConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\RenderMaterialToHostConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\Raw\SurfaceConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\BaseTopLevelConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\BrepToHostTopLevelConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\DirectShapeTopLevelConverterToHost.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\LevelToHostTopLevelConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\GridlineToHostTopLevelConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\MeshToHostTopLevelConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\ModelCurveToSpeckleTopLevelConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToHost\TopLevel\PointToHostTopLevelConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToSpeckle\Raw\BeamConversionToSpeckle.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToSpeckle\Raw\BoundarySegmentConversionToSpeckle.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ToSpeckle\Raw\BraceToSpeckleConverter.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ public DB.CurveArray Convert(ICurve target)

case SOG.Curve nurbs:
var n = _curveConverter.Convert(nurbs);

// poc : in original converter, we were passing a bool into this method 'splitIfClosed'.
// https://spockle.atlassian.net/browse/DUI3-462
// I'm not entirely sure why we need to split curves, but there are several occurances
// of the method being called and overriding the bool to be true.

//if (IsCurveClosed(n) && splitIfClosed)
//{
// var split = SplitCurveInTwoHalves(n);
// curveArray.Append(split.Item1);
// curveArray.Append(split.Item2);
//}
//else
//{
// curveArray.Append(n);
//}
curveArray.Append(n);
return curveArray;

Expand All @@ -99,30 +83,4 @@ public DB.CurveArray Convert(ICurve target)
throw new SpeckleConversionException($"The provided geometry of type {target.GetType()} is not a supported");
}
}

public bool IsCurveClosed(DB.Curve nativeCurve, double tol = 1E-6)
{
var endPoint = nativeCurve.GetEndPoint(0);
var source = nativeCurve.GetEndPoint(1);
var distanceTo = endPoint.DistanceTo(source);
return distanceTo < tol;
}

public (DB.Curve, DB.Curve) SplitCurveInTwoHalves(DB.Curve nativeCurve)
{
using var curveArray = new DB.CurveArray();
// Revit does not like single curve loop edges, so we split them in two.
var start = nativeCurve.GetEndParameter(0);
var end = nativeCurve.GetEndParameter(1);
var mid = start + (end - start) / 2;

var a = nativeCurve.Clone();
a.MakeBound(start, mid);
curveArray.Append(a);
var b = nativeCurve.Clone();
b.MakeBound(mid, end);
curveArray.Append(b);

return (a, b);
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
using Autodesk.Revit.DB;
using Speckle.Converters.Common;
using Speckle.Converters.Common.Objects;
using Speckle.Converters.RevitShared.ToSpeckle;
using Speckle.DoubleNumerics;
using Speckle.Objects.Other;

namespace Speckle.Converters.RevitShared.ToHost.TopLevel;

[NameAndRankValue(nameof(SOG.Mesh), 0)]
public class MeshToHostTopLevelConverter
: BaseTopLevelConverterToHost<SOG.Mesh, DB.GeometryObject[]>,
ITypedConverter<SOG.Mesh, DB.GeometryObject[]>
public class MeshConverterToHost : ITypedConverter<SOG.Mesh, List<DB.GeometryObject>>
{
private readonly ITypedConverter<SOG.Point, DB.XYZ> _pointConverter;
private readonly ITypedConverter<RenderMaterial, DB.Material> _materialConverter;

public MeshToHostTopLevelConverter(
public MeshConverterToHost(
ITypedConverter<SOG.Point, XYZ> pointConverter,
ITypedConverter<RenderMaterial, DB.Material> materialConverter
)
Expand All @@ -24,7 +20,7 @@ public MeshToHostTopLevelConverter(
_materialConverter = materialConverter;
}

public override GeometryObject[] Convert(SOG.Mesh mesh)
public List<DB.GeometryObject> Convert(SOG.Mesh mesh)
{
TessellatedShapeBuilderTarget target = TessellatedShapeBuilderTarget.Mesh;
TessellatedShapeBuilderFallback fallback = TessellatedShapeBuilderFallback.Salvage;
Expand Down Expand Up @@ -85,7 +81,7 @@ public override GeometryObject[] Convert(SOG.Mesh mesh)
tsb.Build();
var result = tsb.GetBuildResult();

return result.GetGeometricalObjects().ToArray();
return result.GetGeometricalObjects().ToList();
}

private static bool IsNonPlanarQuad(IList<XYZ> points)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading