DynamoDS / Dynamo

Open Source Graphical Programming for Design
https://dynamobim.org
Other
1.74k stars 634 forks source link

Extracted elements of geometry arbitrarily disassociated from parent (and translated) #10899

Open vykrum opened 4 years ago

vykrum commented 4 years ago

Dynamo version

2.8.0.1941

Operating system

Windows 10

What did you do?

//Mesh
msh1 = Dynamo.Mesh.Remesh(Dynamo.Mesh.Translate(Dynamo.Mesh.ImportFile(fil), -399000, -801000, 0));

//Slice intervals
intr = 250;

//Bounding Cuboid
bcb1 = Cuboid.ByCorners(Point.ByCoordinates(0,0,-100),Point.ByCoordinates(1500,3000,100));

//Cutting Planes
pln1 = Plane.ByOriginNormal(Point.ByCoordinates(0,0..3000..intr),Vector.YAxis());

//Slicing
msk1 = List.Contains(DSCore.Object.IsNull(msh1.Intersect(pln1<1>))<1>,true);
slc1 = List.Clean(List.Flatten(msh1.Intersect(pln1<1>)<1>,-1),false)<1>;
slc2 = List.Flatten(List.FilterByBoolMask(bcb1.Intersect(pln1),msk1)["out"],-1);
crv1 = PolyCurve.ByJoinedCurves(slc2.PerimeterCurves());
crv2 = List.Flatten(List.AddItemToFront(crv1<1>,slc1<1>)<1>,-1);
slc3 = slc2.TrimWithEdgeLoops(crv2);

//Cross Sectional Areas (Hollow)
cra1 = slc2.Area - slc3.Area;

What did you expect to see?

A trimmed surface at the same position

What did you see instead?

The resulting surface is transformed arbitrarily (it seems) as obserbed with reference to the background grid in the attached image. mesh_2020-07-17_12-27-52

vykrum commented 4 years ago

Seems like the problem actually starts earlier, not with Surface.TrimWithEdgeLoops mesh_2020-07-17_07-19-25

Amoursol commented 4 years ago

@mjkkirschner This issue is the same we discussed today, resulting from a similar approach to my conversation next week with AECOM. Referenced an an example here: https://forum.dynamobim.com/t/mesh-and-surface-intersection-overlap/53024/8

Amoursol commented 3 years ago

Hello @vykrum - We have updated Surface.TrimWithEdgeLoops in Dynamo 2.9 - https://github.com/DynamoDS/Dynamo/pull/11130. Does this solve the issue above?