Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gr = Import["c:\DolphinSharkBox.obj" ];
- Graphics3D[gr[[1]]]
- grc = Import["... \DophinSharkBox.obj", "GraphicsComplex"];
- Graphics3D[grc]
- polygonsc = Join @@ (Normal[grc] /.
- HoldPattern[VertexNormals -> _] :> Sequence[]);
- polygonsc = polygonsc /. Polygon -> Sequence;
- edgesc = DeleteDuplicates[UndirectedEdge @@@ Map[ToString,
- Select[Subsets[polygonsc, {2}], Intersection @@ # =!= {} &], {-2}]];
- cc = Map[ToExpression, ConnectedComponents[Graph[edgesc]], {-1}];
- Through@{Length@# &, Tally[Length /@ #] &}@ cc
- (* {41, {{3804, 1}, {952, 1}, {288, 2}, {38, 24}, {28, 12}, {6, 1}}} *)
- Graph[edgesc, VertexStyle -> White, VertexSize -> .005, VertexShapeFunction -> "Point",
- EdgeStyle -> Directive[Opacity[.5], Thin, Hue[.35, .5, .8]],
- Background -> Black, EdgeShapeFunction -> (Line[#1] &), ImageSize -> 600]
- Graphics3D[({EdgeForm[], Hue[RandomReal[]], Polygon@#} & /@ cc), Lighting ->"Neutral"]
- Graphics3D[({EdgeForm[], Hue[RandomReal[]], Polygon@# }&/@cc[[;;2]]), Lighting -> "Neutral"]
- Graphics3D[({EdgeForm[],Hue[RandomReal[]],Polygon@#}&/@ cc[[3;;-2]]), Lighting -> "Neutral"]
Add Comment
Please, Sign In to add comment