Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help solving this problem by writing a python3 program for it. Any help is appreciated. 3. Consider the polygons that make up the
I need help solving this problem by writing a python3 program for it. Any help is appreciated.
3. Consider the polygons that make up the two-dimensional region The author has represented the region using an face-dictionary 'faces = {'fO':'vo', 'vl', 'v5'), 'fl':l'vl', 'v3', '4', 'v5'], '62': I'vo', '2', 'v5'] } The keys are the faces and the values are the vertices. So face 0 (a triangle) contains vertices 0, 1 and 5; face 1 (a quadrilateral) contains vertices 1, 3, 4, and 5; face 2 (a triangle) contains vertices 0, 2 and 5. Write a program that, given a face-dictionary, computes the corresponding vertex-dictionary and edge- dictionary, telling you which face a vertex, resp. edge, is contained in. In the above example, these dictionaries would be vertices = {'vo':'0', '2'), 'vl':'0', '1'), 'V2': ['2'), v3': 'fl'), ... edges = {['0', '2' 1: ['f2'], ['v2', 'v5']: ['f2'], ['0', 'v5'] : ['f2', '10'], ... } } Use dictionary comprehension and iteration over elements wherever possible. I leave it up to you to use lists, tuples or sets to represent collections of elementsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started