Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3213242
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T14:55:21+00:00 2026-05-17T14:55:21+00:00

I have a set of points to define a shape. These points are in

  • 0

I have a set of points to define a shape. These points are in order and essentially are my “selection”.

I want to be able to contract this selection by an arbitrary amount to get a smaller version of my original shape.

In a basic example with a triangle, the points are simply moved along their normal which is defined by the points to the left and the right of the points in question.

Eventually all 3 points will meet and form one point but until that point they will make a smaller and smaller triangle.

For more complex shapes, when moving the individual points inward, they may pass through the outer edge of the shape resulting in weird artifacts. Obviously I’ll need to cull these points and remove them from the array.

Any help in exactly how I can do that would be greatly appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T14:55:21+00:00Added an answer on May 17, 2026 at 2:55 pm

    This is just an idea but couldn’t you find the center of mass of the object, create a vector from the center to each point, and move each point along this vector?

    To find the center of mass would of course involve averaging each x and y coordinate. Getting a vector is as simple a subtracting the point in question with the center point. Normalizing and scaling are common vector operations that can be found with the Google.

    EDIT
    Another way to interpret what you’re asking is you want to erode your collection of points. As in morphology erosion. This is typically applied to binary images but you can slightly modify the concept to work with a collection of points. Essentially, you need to write a function that, given a point, will return true (black) or false (white) depending on if that point is inside or outside the shape defined by your points. You’d have to look up how to do that for shapes that aren’t always concave (it’s harder but not impossible).

    Now, obviously, every single one of your actual points will return false because they’re all on the border (by definition). However, you now have a matrix of points around your point of interest that define where is “inside” and where is “outside”. Average all of the “inside” points and move your actual point along the vector between itself and towards this average. You could play with different erosion kernels to see what works best.

    You could even work with a kernel with floating point weights instead of either/or values which will affect your average calculation proportional to their weights. With this, you could approximate a circular kernel with a low number of points. Try the simpler method first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set of points which lies on the image. These set of points
I have a set of points that i want to turn into a closed
I have an arbitrary curve (defined by a set of points) and I would
I have a set S of points (2D : defined by x and y)
I have set break points on my attached properties SetXXX and GetXXX static methods.
I have a set of points represented as a 2 row by n column
I have a set of data points in 3D space which apparently all fall
I have a set of 2D points inside a finite 2D region of space
I have a set of 2D points each with an associated id. (e.g. if
I have a set of transactions occurring at specific points in time: CREATE TABLE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.