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

  • SEARCH
  • Home
  • 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 4590344
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:14:19+00:00 2026-05-21T22:14:19+00:00

Given is a 2D are with the polygons. I need to find out the

  • 0

Given is a 2D are with the polygons. I need to find out the polygons visible in a perpendicular line of sight from the a given line segment lying within that area. e.g.

A sample example of the problem

  • Further,

    What can be the optimizations when the polygons have only vertical and horizontal edges.

  • 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-21T22:14:20+00:00Added an answer on May 21, 2026 at 10:14 pm

    I’d suggest the following …

    • Rotate the problem so your ‘line of sight’ segment is aligned to the x axis.
    • Find the (axis aligned) bounding rectangle (BR) of each polygon.
    • Sort the polygons using the Y coordinate of the bottom edge of each BR
    • Create a clipping ‘range buffer’ to mark the portions of the viewing segment that will be no longer visible.
    • For each polygon C (current) in the sorted list do …
      1. Use C’s left and right bounds as its initial clipping range.
      2. Trim C’s clipping range with the range already marked as clipped in the ‘range buffer’.
      3. Now for each subsequent polygon S of a similar depth (ie where S’s BR bottom edge starts below C’s BR top edge) …
        • loop to next S if it doesn’t overlap horizontally with C
        • determine if S is overlapping from the left or right (eg by comparing the BR horizontal midpoints of S and C). If S overlaps from the right and S’s left-most vertex is below C’s right-most vertex, then truncate C’s clipping range accordingly. (Likewise if S overlaps from the left.)
      4. If the residual clipping range isn’t empty, then at least part of C is visible from your viewing segment. Now add C’s residual clipping range to the clipping ‘range buffer’.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a series of GPS coordinate pairs, I need to calculate the area of
I have a list of Shapely polygons in Python. To find out which polygon
from the title you can read that I'm given latitude and longitude points. They
Given four (x,y) pairs that represent the four corners of an arbitrary polygon (quadrilateral)
Given 2 rgb colors and a rectangular area, I'd like to generate a basic
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
I'm trying to programmatically generate beveled edges for 2D polygons. For example, given an
I am writing a program in which I need to draw polygons of an
I have a set of simple (no holes, no self-intersections) polygons, and I need
I need to compute the area of the region of overlap between two triangles

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.