Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #13803
| Newsgroups | comp.programming |
|---|---|
| Date | 2021-09-14 08:57 -0700 |
| References | <99bbb6f1-6e04-4f01-9e53-5a1eed715bf6n@googlegroups.com> <46bc4a8b-b4e5-4263-b1ff-a7b887caf0bdn@googlegroups.com> |
| Message-ID | <a875dc20-e6df-42d7-b077-6b110aa248fdn@googlegroups.com> (permalink) |
| Subject | Re: Squares under a curve. |
| From | Julio Di Egidio <julio@diegidio.name> |
On Tuesday, 14 September 2021 at 17:47:20 UTC+2, Julio Di Egidio wrote: > On Tuesday, 14 September 2021 at 15:30:26 UTC+2, Malcolm McLean wrote: > > > I've got a long thin image which consists of a frieze of identical square cells. > So, if I get you right, your image is rectangular with dimensions -say- WxH (e.g. W could be 1024 and H would be 64, for 16 squares in total). > > I've also got a wall of varying height, described by a complex function. > Which I read that your wall has horizontal base and vertical sides, just the top is curvilinear and describe by some function h(x) for x ranging over the base of the wall. > > Correct that far? > > I want to distort the image so as to retain the aspect ratio of the cells, whist stretching it to the height of the wall. > Here you should be specific: "distorted" how exactly? In the scenario depicted above, just the upper side of the squares (and of the whole image) must become curvilinear, the other sides have to remain straight, so there is no way to actually preserve the aspect ratio. And, in that scenario, a simple approach would to enlarge and deform the whole image in order to make it match the wall shape, i.e. disregarding the single squares and just stretching in height along the image in order to match the height of the wall at every point... So, what do you really have in mind? Moreover, concretely, there is no such thing as an image that is not rectangular, so it's really not clear (to me at least) what you are trying to do. Julio > > Sometime the function might go to zero or close to zero, so there also needs to be a cut off point to avoid a large accumulation of very small cells. > > > > My current attempt is to take a lot of wall height samples. > <snip> > > There should be some closed form solution, no need for brute force or similar, but you'll have to clarify your "geometric" requirements above.
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Squares under a curve. Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-09-14 06:30 -0700
Re: Squares under a curve. Julio Di Egidio <julio@diegidio.name> - 2021-09-14 08:47 -0700
Re: Squares under a curve. Julio Di Egidio <julio@diegidio.name> - 2021-09-14 08:54 -0700
Re: Squares under a curve. Julio Di Egidio <julio@diegidio.name> - 2021-09-14 08:57 -0700
Re: Squares under a curve. Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2021-09-14 10:56 -0700
csiph-web