# Subdivide mesh into more segment?

**URL:** <https://discourse.mcneel.com/t/subdivide-mesh-into-more-segment/14351>\
**Category:** Scripting\
**Created:** [November 26, 2014, 12:36am UTC](https://discourse.mcneel.com/t/subdivide-mesh-into-more-segment/14351 "2014-11-26T00:36:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![samphi](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samphi](https://discourse.mcneel.com/u/samphi)\
**Post date:** [November 26, 2014, 12:36am UTC](https://discourse.mcneel.com/t/subdivide-mesh-into-more-segment/14351/1 "2014-11-26T00:36:34Z")

</div>

hi guys!

i have a mesh-surface and want it to have more respectively less segments.  
i made this mesh in a specific way cause it is a study project, and i had to use this scripts.

but i dont know how i can make the surface more/less segment with 2 parameters for the 2 directions.

i am looking for the shortest way to do that cause i should not change the scripts to much.  
here 2 pictures for better understanding:  
 ![](https://sea3.discourse-cdn.com/mcneel/uploads/default/14032/450df658e48158b3.JPG) ![](https://sea3.discourse-cdn.com/mcneel/uploads/default/14033/085ae2e4c14f88c1.JPG)

and my python script:

[33.gh](https://sea3.discourse-cdn.com/mcneel/uploads/default/14034/b0b8a5a329f00323.gh) (13.1 KB)

hopefully greets 😉

---

<div class="post-metadata">

**Author:** ![clement](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/clement/32/759176_2.png) [@clement](https://discourse.mcneel.com/u/clement)\
**Post date:** [November 27, 2014, 2:53am UTC](https://discourse.mcneel.com/t/subdivide-mesh-into-more-segment/14351/2 "2014-11-27T02:53:55Z")

</div>

Hi Pilipp,

in your first python component, you created a mesh from the sweep surface using:

```
mesh = Rhino.Geometry.Mesh.CreateFromBrep(sweepBrep)

```

Instead of doing this, you can get control of the mesh UV density by using the mesh UV component. First set the output in your first python component to output the sweepSurface instead of the mesh, no need to output or create the mesh from the brep:

```auto
# not required:
# mesh = Rhino.Geometry.Mesh.CreateFromBrep(sweepBrep)

# new output
geometry = sweepBrep

```

then use the component to create a UV Mesh as shown in the picture below.

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

does this help ?

- 

c.

---

<div class="post-metadata">

**Author:** ![samphi](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samphi](https://discourse.mcneel.com/u/samphi)\
**Post date:** [November 27, 2014, 8:45am UTC](https://discourse.mcneel.com/t/subdivide-mesh-into-more-segment/14351/3 "2014-11-27T08:45:19Z")

</div>

thank you verry much clement!

this was exactly what i am looking for!!  
it helps me a lot!
