# Image Sampler Issue

**URL:** <https://discourse.mcneel.com/t/image-sampler-issue/72017>\
**Category:** Grasshopper\
**Created:** [September 29, 2018, 5:53am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017 "2018-09-29T05:53:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lushuchen1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lushuchen1993/32/117680_2.png) [@lushuchen1993](https://discourse.mcneel.com/u/lushuchen1993)\
**Post date:** [September 29, 2018, 5:53am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/1 "2018-09-29T05:53:17Z")

</div>

Hi,

I just tried to apply this pattern on the suface (in red in the image below) of the building I designed by image sampler.

The surface is like this, very curvy

 ![1](https://global.discourse-cdn.com/mcneel/original/3X/0/5/054c2995ad2127ab647ce068a7f9854fd89f6adc.png)

And the pattern is supposed to be like this

 ![3](https://global.discourse-cdn.com/mcneel/original/3X/d/7/d79fa00ea0ff38071ee601faf5e6fa034a1a4008.png)

However, by image sampler, all circles are in the same radius, I do not know why.

 ![2](https://global.discourse-cdn.com/mcneel/original/3X/7/8/782534924a250bdcd02b74bff8b24b898a0858de.png)

Actually, the pattern was made by a script I downloaded online, however, if I apply the surface into the downloaded script directly, it dosen’t work properly somehow.

My own script is like this:

 ![4](https://global.discourse-cdn.com/mcneel/original/3X/8/5/851e1280bdddb154160473cc810e3def5bf345ac.png)

And also I have attached the script I downloaded online.

If someone could help me with this issue, I will really appreciate!

[Dimple\_halftone\_outline.3dm](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/3/3/338984276d7f0623e2e496c6007910d62e509562.3dm) (48.2 KB)  
[Dimple\_Halftone\_Shopbot Writer.ghx](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/7/a/7adfed000b209560c24953f67efa5fe8dd34c079.ghx) (480.1 KB)  
[Surface 2.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/0/00dabb0e836134eeb31472871f37e1ae4159cec3.gh) (1.0 MB)  
[Prototype 1.3dm](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/b/a/ba173b4011cf4e5af471cf113788a7197fc88a71.3dm) (2.0 MB)

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [September 29, 2018, 6:48am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/2 "2018-09-29T06:48:38Z")

</div>

Looking at the image, I think the remap component is wrong? Isn’t the source domain supposed to be (0 to 1)?

---

<div class="post-metadata">

**Author:** ![lushuchen1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lushuchen1993/32/117680_2.png) [@lushuchen1993](https://discourse.mcneel.com/u/lushuchen1993)\
**Post date:** [September 29, 2018, 7:03am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/3 "2018-09-29T07:03:51Z")

</div>

Hi, David,

Thank you for reply.

I initially did not add remap there. So it got this image, which seems the image in the Image Sampler doesn’t fit the surface properly. This make me very crazy to figure it out.

 ![%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20180929170121](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/6/56f9555e1a4124b910a3a9cc039fc11098e8aa11.png)

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [September 29, 2018, 7:26am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/4 "2018-09-29T07:26:05Z")

</div>

I don’t have Rhino at my disposal at the moment, but in your latest image there’s no reason to believe the image sampler domain and the surface UV domain are the same.

---

<div class="post-metadata">

**Author:** ![Adam\_M](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/adam_m/32/769331_2.png) [@Adam\_M](https://discourse.mcneel.com/u/Adam_M)\
**Post date:** [September 29, 2018, 7:33am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/6 "2018-09-29T07:33:16Z")

</div>

Is this what you are tying to do?

[Surface 2\_Rev2.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/2/8/288dec82cd6cf3079e8e38496d4acdbc4730ef24.gh) (1.0 MB)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/4/b/4baf5e9c973710a98a24c26a49f6ac8156582152.jpeg)

---

<div class="post-metadata">

**Author:** ![lushuchen1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lushuchen1993/32/117680_2.png) [@lushuchen1993](https://discourse.mcneel.com/u/lushuchen1993)\
**Post date:** [September 29, 2018, 10:26am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/7 "2018-09-29T10:26:11Z")

</div>

Hi, Adam,

Thank you for reply. What you did is almost about what I am trying to do. However, the patter seems to be strecthed along the curvy surface. What I am trying to do is like this picture does:

 ![3](https://global.discourse-cdn.com/mcneel/original/3X/d/7/d79fa00ea0ff38071ee601faf5e6fa034a1a4008.png)

I know the image is not long enough to fit the surface, so is there some way allow the image repeat properly along the surface in order to create this sort of pattern as the picture above shows?

---

<div class="post-metadata">

**Author:** ![Adam\_M](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/adam_m/32/769331_2.png) [@Adam\_M](https://discourse.mcneel.com/u/Adam_M)\
**Post date:** [September 29, 2018, 11:36am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/8 "2018-09-29T11:36:20Z")

</div>

Maybe like this? Although it seems fairly process heavy, so maybe there is a smarter way.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/b/4/b4d551db42ebac0303635edc5a533eb5ccc706a1.jpeg)

---

<div class="post-metadata">

**Author:** ![lushuchen1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lushuchen1993/32/117680_2.png) [@lushuchen1993](https://discourse.mcneel.com/u/lushuchen1993)\
**Post date:** [September 29, 2018, 11:59am UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/9 "2018-09-29T11:59:38Z")

</div>

Yes, just this! Thank you!

You are so smart!

---

<div class="post-metadata">

**Author:** ![lushuchen1993](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lushuchen1993/32/117680_2.png) [@lushuchen1993](https://discourse.mcneel.com/u/lushuchen1993)\
**Post date:** [September 29, 2018, 1:19pm UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/10 "2018-09-29T13:19:34Z")

</div>

One more question, Adam,

I am trying to use boundarySurface to generate circular surfaces, and use them to punch holes on the long curvy surface via command Regin Difference, but it doesn’t work somehow. Is there any other way to punch those small circles on the surface underneath?

 ![%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20180929231900](https://global.discourse-cdn.com/mcneel/original/3X/7/1/71a7e3923e7fdfd762aec9ae8d8c1a30b0ea2256.png)

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [September 29, 2018, 2:48pm UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/11 "2018-09-29T14:48:11Z")

</div>

Regions are planar, you can’t use them on curved surfaces. Be warned though that no matter what you end up doing, punching a lot of small holes in a surface is a _slow_ operation. One thing you can do is create spheres instead of circles and cut with those instead using the Trim Solid component, but be prepared to wait for it.

---

<div class="post-metadata">

**Author:** ![Adam\_M](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/adam_m/32/769331_2.png) [@Adam\_M](https://discourse.mcneel.com/u/Adam_M)\
**Post date:** [September 29, 2018, 9:14pm UTC](https://discourse.mcneel.com/t/image-sampler-issue/72017/12 "2018-09-29T21:14:59Z")

</div>

I think I may have uploaded the wrong file earlier, so here it is again, just in case.

[Surface 2\_Rev3.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/c/f/cf387931d7478860c784a56a45fe2120521f3fd3.gh) (1.0 MB)

I attempted to pull the curves to the surface (which was reasonably quick, around 20 seconds), and then split the surface using these curves but as Mr Rutten said “slow process”…my laptop couldn’t handle it 😕
