Grasshopper

algorithmic modeling for Rhino

I wanna create List<Surface> something like that (Bottom).

What's the problem of my script ?

protected override void SolveInstance(IGH_DataAccess DA)
{
Brep brep = null;
double factor = double.MaxValue;

if (!DA.GetData(0, ref brep))
return;
if (!DA.GetData(1, ref factor))
return;

List<Surface> srfs = new List<Surface>();

Interval inter = new Interval(0, 1);

for(Int32 i = 0; i <brep.Surfaces.Count ; i++)
{
brep.Surfaces[i].SetDomain(0, inter);
brep.Surfaces[i].SetDomain(1, inter);

Point3d center = Point3d.Unset;

center = brep.Surfaces[i].PointAt(0.5, 0.5);

brep.Surfaces[i].Transform(Transform.Scale(center, factor));

srfs.Add(brep.Surfaces[i]);
}

DA.SetDataList(0, srfs);
}

Thanks in advance :D

Views: 780

Replies to This Discussion

Surface types are untrimmed. If you want to keep trims, use brep and brep face instead of surface.

Hi Hannes ~

You mean brep or brep face data type has trimmed information ?

Thanks :D

A Brep is a topological type collection of objects, it consists of the following data (not an exhaustive list):

  • Faces (each face is a surface with trim and loop and edge information)
  • Edges (the 3D curves around all faces)
  • Loops (lists of edges that form closed loops)
  • Vertices (all the sharp kinks in all loops)
  • UV curves (representations of trims in each face's UV space)
  • Meshes (optional, but each face can have several type of mesh associated with it)
  • Topological data. Each face knows which trims surround it. Each edge knows which faces border it. Each vertex knows which curves meet there etc. etc.

--

David Rutten

david@mcneel.com

Thanks David :D~~

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service