# Split face

**URL:** <https://discourse.mcneel.com/t/split-face/11846>\
**Category:** Rhino Developer\
**Created:** [September 22, 2014, 8:31am UTC](https://discourse.mcneel.com/t/split-face/11846 "2014-09-22T08:31:41Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 22, 2014, 8:31am UTC](https://discourse.mcneel.com/t/split-face/11846/1 "2014-09-22T08:31:41Z")

</div>

Hi

I want split this BrepFace into 3 BrepFaces

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/12306/bc0b0facd7b7336f.png)

I can get the vertical split curve from the wired model.

I’ve tried split using BrepFace.Split function, but I can’t get the result that I need.

I’m working with rhinoCommon and c#

Thanks

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 22, 2014, 10:36am UTC](https://discourse.mcneel.com/t/split-face/11846/2 "2014-09-22T10:36:32Z")

</div>

It would help if you could post the code you use that is not working for you…

---

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 22, 2014, 1:28pm UTC](https://discourse.mcneel.com/t/split-face/11846/3 "2014-09-22T13:28:19Z")

</div>

I try split the face three ways:

```
if (!face.IsPlanar())
{
    // 1
    // split is empty
    Surface[] split = face.Split(0, 1);
    
    // 2
    // wired contains all vertical curves from face model 
    Curve[] wired = face.ToBrep().GetWireframe(1).Where(c => c.PointAtStart.Z != c.PointAtEnd.Z).ToArray<Curve>();
    // The brep is a horizontal brep
    Brep split2 = face.Split(wired, 1);

    // 3
    // idem case 2
    Curve[] iso = face.TrimAwareIsoCurve(0, 1);
    Brep split3 = face.Split(iso, RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
}
```

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 22, 2014, 2:35pm UTC](https://discourse.mcneel.com/t/split-face/11846/4 "2014-09-22T14:35:51Z")

</div>

In case 1 you use the split along isocurve at parameter value of 1. Maybe the value of 1 is not in the domain of the surface underlying the face, or parameter of 1 only available outside trimmed regions.

In case 2, you use a tolerance of 1, which may be a bit large.

In case 3, again you use an iso curve at parameter value 1. Are you sure that the curve is on the surface?

---

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 22, 2014, 3:32pm UTC](https://discourse.mcneel.com/t/split-face/11846/5 "2014-09-22T15:32:34Z")

</div>

Sorry, but I don’t understand your responses:

Case 1: How Can I get the correct second parameter?

Case 2: I try with lower tolerance values but not get the desired result

Can you give me an example of how Split the face into 3 segments?

Thanks

---

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 23, 2014, 10:35am UTC](https://discourse.mcneel.com/t/split-face/11846/6 "2014-09-23T10:35:49Z")

</div>

any idea?

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 23, 2014, 10:41am UTC](https://discourse.mcneel.com/t/split-face/11846/7 "2014-09-23T10:41:55Z")

</div>

A surface has two parameters: U and V (0 and 1). These parameters have domains, within which they describe the surface.

If you say `face.Split(0,1)` you split the face at U-parameter value of 1. But, it is not at all clear that the value of 1 is inside the U-domain, and if it is in the U-domain that it is “visible” (i.e. not trimmed).

You must first determine the value of the parameter at which you want to split.

---

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 23, 2014, 1:15pm UTC](https://discourse.mcneel.com/t/split-face/11846/8 "2014-09-23T13:15:01Z")

</div>

But, how I can set the value parameter?

In the next image

![](https://sea3.discourse-cdn.com/mcneel/uploads/default/12314/a5cd37d7e44f029d.png)

I can get the vertical curve to split the surface in two parts, but I don’t know how call the split function

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 24, 2014, 6:22am UTC](https://discourse.mcneel.com/t/split-face/11846/9 "2014-09-24T06:22:41Z")

</div>

The command below works on the file attached. Can you share your file with the surface that does not want to be split?

```auto
ObjRef sRef;
Result res = RhinoGet.GetOneObject("Select brep-face to split", false, ObjectType.Surface, out sRef);
if (res != Result.Success)
    return res;

BrepFace face = sRef.Surface() as BrepFace;
if (null == face)
    return Result.Failure;

Curve[] wired = face.ToBrep().GetWireframe(1).Where(c => c.PointAtStart.Z != c.PointAtEnd.Z).ToArray();

Brep splitted = face.Split(wired, doc.ModelAbsoluteTolerance);
if (null != splitted)
    doc.Objects.AddBrep(splitted);

return Result.Success;

```

[FaceSplit.3dm](https://sea3.discourse-cdn.com/mcneel/uploads/default/12331/9d5e015eb955689a.3dm) (29.3 KB)

---

<div class="post-metadata">

**Author:** ![jordy1989](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jordy1989/32/282567_2.png) [@jordy1989](https://discourse.mcneel.com/u/jordy1989)\
**Post date:** [September 24, 2014, 6:49am UTC](https://discourse.mcneel.com/t/split-face/11846/10 "2014-09-24T06:49:32Z")

</div>

Can you explain this row for me?  
What does it do and how does it work? 🙂

I do it differently like extruding the curve first so i have a srf that splits them but a crv would be way better and faster.  
I’m using [vb.net](http://vb.net) but I dont understand the `Where(c =&gt; c.PointAtStart.Z != c.PointAtEnd.Z)` part.

> [@menno](#):
>
> Curve wired = face.ToBrep().GetWireframe(1).Where(c =\> c.PointAtStart.Z != c.PointAtEnd.Z).ToArray();

Just see you dont use curves to split but use the wireframe. Its still early i Guess xD

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 24, 2014, 7:49am UTC](https://discourse.mcneel.com/t/split-face/11846/11 "2014-09-24T07:49:25Z")

</div>

This is taken exactly from the OP’s code, where for this specific case he was interested in the vertical lines.

---

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 24, 2014, 8:07am UTC](https://discourse.mcneel.com/t/split-face/11846/12 "2014-09-24T08:07:58Z")

</div>

Hi menno.

```
Brep splitted = face.Split(wired, doc.ModelAbsoluteTolerance);

```

Brep splitted is a polysurface, and from rhino, if I exec explode command, splitted is divided in 3 segments. The result that I need

But,from code, I don’t know how explode splitted

and jordy1989, the line

```
Curve[] wired = face.ToBrep().GetWireframe(1).Where(c => c.PointAtStart.Z != c.PointAtEnd.Z).ToArray();

```

returns an array with all vertical curves that composing the face model.

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 24, 2014, 8:14am UTC](https://discourse.mcneel.com/t/split-face/11846/13 "2014-09-24T08:14:46Z")

</div>

Ah, I see.

Try this:

```auto
foreach(BrepFace f in splitted.Faces)
{
    doc.Objects.AddBrep(f.DuplicateFace(false)); // duplicate face will create a separate brep of each face
}

```

---

<div class="post-metadata">

**Author:** ![Manolo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/manolo/32/4556_2.png) [@Manolo](https://discourse.mcneel.com/u/Manolo)\
**Post date:** [September 24, 2014, 8:24am UTC](https://discourse.mcneel.com/t/split-face/11846/14 "2014-09-24T08:24:44Z")

</div>

Yeah!! it works!!!

Thank you very much!

I owe you a beer … or several !! =)

EDIT: the bucle is:

```
foreach(BrepFace f in splitted.Faces)
{
    doc.Objects.AddBrep(f.DuplicateFace(false)); // duplicate face will create a separate brep of each face
}
```

---

<div class="post-metadata">

**Author:** ![menno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/menno/32/770384_2.png) [@menno](https://discourse.mcneel.com/u/menno)\
**Post date:** [September 24, 2014, 8:50am UTC](https://discourse.mcneel.com/t/split-face/11846/15 "2014-09-24T08:50:20Z")

</div>

Excellent. Glad I could help - it took a while for me to understand your needs.
