public static VimScene ToVim(this Va3cContainer va3c) { var db = new DocumentBuilder(); var geometryLookup = new Dictionary <string, int>(); foreach (var g in va3c.geometries) { geometryLookup.Add(g.uuid, geometryLookup.Count); } db.AddGeometries(va3c.geometries.Select(ToGeometryBuilder)); ProcessNode(db, va3c.obj, geometryLookup); return(new VimScene(db.ToDocument())); }
public static void SaveAsVim(this Va3cContainer va3c, string filePath) { var db = new DocumentBuilder(); var geometryLookup = new Dictionary <string, int>(); foreach (var g in va3c.geometries) { if (g != null && g.data.vertices.Count > 0 && g.data.faces.Count > 0) { geometryLookup.Add(g.uuid, geometryLookup.Count); } } db.AddGeometries(va3c.geometries.Select(ToGeometryBuilder)); ProcessNode(db, va3c.obj, geometryLookup); Serializer.Serialize(db.ToDocument(), filePath); }