conda-forge / shapely-feedstock

A conda-smithy repository for shapely.
BSD 3-Clause "New" or "Revised" License
9 stars 20 forks source link

Border points that are not touched by a figure #142

Closed mining-james1410 closed 1 month ago

mining-james1410 commented 1 month ago

Comment:

Hello, whilst developping a code, I got a small impass. Briefly, I want to get points in the border of a figure that latter on I will use in the function touches along with the border I used firstly. However , when I try I obtain an intersection but is not recognaized when I use the touches function.

import shapely as sham

import numpy as np import pyvista as pv

Here I create a line and a triagle which boundaries ("border") I will use to obtain the intersection

line=sham.LineString(([0,0,0],[2,2,0]))

triangle=sham.Polygon(([1,0,0],[-1,1,0],[-1,-1,0]))

bounds=triangle.boundary

I create an intersection which should be a point

intersect=sham.intersection(line, bounds)

I use the function touches which end up giving me False

print(sham.touches(intersect, triangle))

I would like to know why this happens and if there is something I can do to make it work. I have already tried prepare() and using gride_size. I someone knows a better function than intersection to do this I would be grateful.

akrherz commented 1 month ago

Greetings @mining-james1410 , this github repository deals with the packaging of shapely for conda-forge and isn't the appropriate place to get general library usage help. Please see shapely/shapely