本文へ移動
日本語
「立体の断面」は Pro に含まれます。解除するとプレビューが表示されます。

仕組み

水平な面で切った立体を示す教科書風の図です。立体はニュートラルな色の軸測図で、面より下は塗りつぶし、隠れた辺は破線、面より上は淡い影として描かれ、断面だけがアクセント色です。面の左の角にある目盛りで高さを読み、現在値は濃色のピルに表示されます。右の角の丸いつまみがスライダーです。図の下の行には断面の名前、真上から見た実際の形(面の移動に合わせて拡大・縮小)、面積が出ます。立体ごとに三つの代表的な断面へ移動でき、たとえば頂点で立てた立方体の真ん中の正六角形を確かめられます。

向いている場面

  • Teach solid geometry: let learners discover which polygons a plane can cut from a cube, or why every cut of a sphere is a circle.
  • Introduce Cavalieri's principle or volumes by slicing: read the area of the section at each height.

向かない場面

  • For an arbitrary model from a CAD file, use a 3D viewer with a clipping plane: this figure draws four built-in solids with a level plane.

使い方

import React, { useState } from 'react'
import { KilnSectionPlane } from './KilnSectionPlane.jsx'

export function SectionLesson() {
  const [height, setHeight] = useState(3.46)
  return (
    <KilnSectionPlane
      solid="cube"
      value={height}
      onChange={(next, { shape, area }) => setHeight(next)}
      labels={{ title: 'Sections of a cube' }}
    />
  )
}

プロパティ

プロパティ型既定値説明
solid'cube' | 'tetrahedron' | 'cone' | 'sphere''cube'The solid: a cube of side 4 standing on a corner, a regular tetrahedron of edge 5 resting on an edge, a cone (radius 2.5, height 5) or a sphere (radius 2.5). Each comes with three key cuts.
valuenumber—Controlled height of the plane in centimetres, from 0 to the solid's height (rounded to two decimals).
defaultValuenumber—Starting height when uncontrolled, and what Reset returns to. Defaults to halfway up (a quarter of the way up for the sphere).
onChange(height, { reason, shape, area }) => void—Called with the new height and { reason ('press', 'drag', 'tap', 'key', 'cut', 'cancel' or 'reset'), shape (point, segment, triangle, square, rectangle, hexagon, regularHexagon, circle or polygon), area in cm² }.
stepnumber0.1Height step for the arrow keys. Shift with an arrow, or Page Up and Page Down, move ten steps.
labelsobject—Replaces any built-in text: title, caption, height, heightText ('{h}', '{unit}', '{shape}'), unit, area, areaUnit, cuts, reset and shapes (an object with point, segment, triangle, square, rectangle, hexagon, regularHexagon, circle and polygon).
localestring'en'Language tag for the decimal readouts.
classNamestring—Extra class on the card, for example to set its width (30rem by default, never wider than its container).

アクセシビリティ

  • The grip is a vertical slider labelled with the plane height: Up and Down (or Right and Left) move 0.1 cm, Shift with an arrow or Page Up and Page Down move 1 cm, Home and End go to the bottom and the top. Its value text reads the height and the name of the section.
  • The name and area of the section are a polite live region. Each key cut is a toggle button that is pressed while the plane is at its height. Reset is marked unavailable while nothing has changed.
  • Dragging uses pointer capture. The grip and the height pill take touch drags; a tap elsewhere on the figure moves the plane there, and a vertical swipe on the figure still scrolls the page. A cancelled gesture restores the height it started from.
  • Colour is not the only cue: the section is also named in words and drawn on its own from above.

モーション

キー操作、代表的な断面、リセットの後は、面が 240ms で新しい高さへ移り、その間に断面の形も変わります。ドラッグ中はポインターにそのまま追従します。視差効果を減らす設定では、すべての変化がすぐに反映されます。

プロジェクトに追加

Pro メンバーはプロンプトをコピーし、コーディングエージェントが無料コンポーネントと同じ手順でソースを導入します。

KilnSectionPlane.jsxkiln-section-plane.csstokens.cssREADME.md

2 つのファイルを一緒に導入します。スタイルは tokens.css の変数を読み、予備の値も持つため、単体でも表示できます。

フォーム入力
「空き時間グリッド」は Pro に含まれます。解除するとプレビューが表示されます。
「図形のブール演算」は Pro に含まれます。解除するとプレビューが表示されます。
「カスケード選択」は Pro に含まれます。解除するとプレビューが表示されます。